Thread (12 messages) 12 messages, 2 authors, 2021-08-17

Re: [PATCH 2/4] mm/hwpoison: fix potential pte_unmap_unlock pte error

From: HORIGUCHI NAOYA (堀口 直也) <hidden>
Date: 2021-08-17 23:37:14
Also in: lkml

On Tue, Aug 17, 2021 at 04:24:43PM +0800, Miaohe Lin wrote:
On 2021/8/17 15:29, HORIGUCHI NAOYA(堀口 直也) wrote:
...
quoted
One question is that according to "grep -r pte_unmap_unlock ." command over
whole kernel source code, pte_unmap_unlock() is called with "ptep - 1" in some places.
I think that none of them seems to have "break in for loop" in locked period,
so the same problem does not occur there.  But I'm still not sure why some place
call with "ptep - 1" and the others call with pte returned by pte_offset_map_lock().
IMO pte_unmap_unlock() works as long as the passed in pte belongs to the same page returned
from pte_offset_map_lock(). I have fixed some similar place where pte_unmap_unlock() is called
with wrong "ptep - 1" when I was learning the related mm code.
Great, thanks for clarification.

- Naoya
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help