* + mm-khugepaged-fix-iteration-in-collapse_file.patch added to mm-hotfixes-unstable branch
@ 2023-06-07 17:49 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-06-07 17:49 UTC (permalink / raw)
To: mm-commits, willy, shy828301, peterx, mike.kravetz, kirill,
jiaqiyan, hughd, david, stevensd, akpm
The patch titled
Subject: mm/khugepaged: fix iteration in collapse_file
has been added to the -mm mm-hotfixes-unstable branch. Its filename is
mm-khugepaged-fix-iteration-in-collapse_file.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-khugepaged-fix-iteration-in-collapse_file.patch
This patch will later appear in the mm-hotfixes-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: David Stevens <stevensd@chromium.org>
Subject: mm/khugepaged: fix iteration in collapse_file
Date: Wed, 7 Jun 2023 14:31:35 +0900
Remove an unnecessary call to xas_set(index) when iterating over the
target range in collapse_file. The extra call to xas_set reset the xas
cursor to the top of the tree, causing the xas_next call on the next
iteration to walk the tree to index instead of advancing to index+1. This
returned the same page again, which would cause collapse_file to fail
because the page is already locked.
This bug was hidden when CONFIG_DEBUG_VM was set. When that config was
used, the xas_load in a subsequent VM_BUG_ON assert would walk xas from
the top of the tree to index, causing the xas_next call on the next loop
iteration to advance the cursor as expected.
Link: https://lkml.kernel.org/r/20230607053135.2087354-1-stevensd@google.com
Fixes: a2e17cc2efc7 ("mm/khugepaged: maintain page cache uptodate flag")
Signed-off-by: David Stevens <stevensd@chromium.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jiaqi Yan <jiaqiyan@google.com>
Cc: Kirill A . Shutemov <kirill@shutemov.name>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Peter Xu <peterx@redhat.com>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/khugepaged.c | 1 -
1 file changed, 1 deletion(-)
--- a/mm/khugepaged.c~mm-khugepaged-fix-iteration-in-collapse_file
+++ a/mm/khugepaged.c
@@ -2070,7 +2070,6 @@ static int collapse_file(struct mm_struc
TTU_IGNORE_MLOCK | TTU_BATCH_FLUSH);
xas_lock_irq(&xas);
- xas_set(&xas, index);
VM_BUG_ON_PAGE(page != xas_load(&xas), page);
_
Patches currently in -mm which might be from stevensd@chromium.org are
mm-shmem-fix-race-in-shmem_undo_range-w-thp.patch
mm-khugepaged-fix-iteration-in-collapse_file.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-06-07 17:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-07 17:49 + mm-khugepaged-fix-iteration-in-collapse_file.patch added to mm-hotfixes-unstable branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.