[PATCH v2 06/32] mm/page_vma_mapped: delete bogosity in page_vma_mapped_walk()

Hugh Dickins posted 32 patches 2 years, 8 months ago
[PATCH v2 06/32] mm/page_vma_mapped: delete bogosity in page_vma_mapped_walk()
Posted by Hugh Dickins 2 years, 8 months ago
Revert commit a7a69d8ba88d ("mm/thp: another PVMW_SYNC fix in
page_vma_mapped_walk()"): I was proud of that "Aha!" commit at the time,
but in revisiting page_vma_mapped_walk() for pte_offset_map() failure,
that block raised a doubt: and it now seems utterly bogus.  The prior
map_pte() has taken ptl unconditionally when PVMW_SYNC: I must have
forgotten that when making the change.  It did no harm, but could not
have fixed a BUG or WARN, and is hard to reconcile with coming changes.

Signed-off-by: Hugh Dickins <hughd@google.com>
---
 mm/page_vma_mapped.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/mm/page_vma_mapped.c b/mm/page_vma_mapped.c
index 64aff6718bdb..007dc7456f0e 100644
--- a/mm/page_vma_mapped.c
+++ b/mm/page_vma_mapped.c
@@ -275,10 +275,6 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
 				goto restart;
 			}
 			pvmw->pte++;
-			if ((pvmw->flags & PVMW_SYNC) && !pvmw->ptl) {
-				pvmw->ptl = pte_lockptr(mm, pvmw->pmd);
-				spin_lock(pvmw->ptl);
-			}
 		} while (pte_none(*pvmw->pte));
 
 		if (!pvmw->ptl) {
-- 
2.35.3
Re: [PATCH v2 06/32] mm/page_vma_mapped: delete bogosity in page_vma_mapped_walk()
Posted by Zi Yan 2 years, 7 months ago
On 8 Jun 2023, at 21:12, Hugh Dickins wrote:

> Revert commit a7a69d8ba88d ("mm/thp: another PVMW_SYNC fix in
> page_vma_mapped_walk()"): I was proud of that "Aha!" commit at the time,
> but in revisiting page_vma_mapped_walk() for pte_offset_map() failure,
> that block raised a doubt: and it now seems utterly bogus.  The prior
> map_pte() has taken ptl unconditionally when PVMW_SYNC: I must have
> forgotten that when making the change.  It did no harm, but could not
> have fixed a BUG or WARN, and is hard to reconcile with coming changes.
>
> Signed-off-by: Hugh Dickins <hughd@google.com>

LGTM. Reviewed-by: Zi Yan <ziy@nvidia.com>

--
Best Regards,
Yan, Zi