Re: [PATCH 02/23] mm: Clear vmf->pte after pte_unmap_same() returns

2021-03-23 Thread Peter Xu
On Tue, Mar 23, 2021 at 10:34:45AM +0800, Miaohe Lin wrote: > Hi: > On 2021/3/23 8:48, Peter Xu wrote: > > pte_unmap_same() will always unmap the pte pointer. After the unmap, > > vmf->pte > > will not be valid any more. We should clear it. > > > > It was safe only because no one is accessing

Re: [PATCH 02/23] mm: Clear vmf->pte after pte_unmap_same() returns

2021-03-22 Thread Miaohe Lin
Hi: On 2021/3/23 8:48, Peter Xu wrote: > pte_unmap_same() will always unmap the pte pointer. After the unmap, vmf->pte > will not be valid any more. We should clear it. > > It was safe only because no one is accessing vmf->pte after pte_unmap_same() > returns, since the only caller of

[PATCH 02/23] mm: Clear vmf->pte after pte_unmap_same() returns

2021-03-22 Thread Peter Xu
pte_unmap_same() will always unmap the pte pointer. After the unmap, vmf->pte will not be valid any more. We should clear it. It was safe only because no one is accessing vmf->pte after pte_unmap_same() returns, since the only caller of pte_unmap_same() (so far) is do_swap_page(), where