mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + mm-thp-fix-collapse_files-try_to_unmapfolio.patch added to -mm tree
@ 2022-02-28  5:15 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2022-02-28  5:15 UTC (permalink / raw)
  To: mm-commits, willy, hughd, akpm


The patch titled
     Subject: mm/thp: fix collapse_file()'s try_to_unmap(folio,)
has been added to the -mm tree.  Its filename is
     mm-thp-fix-collapse_files-try_to_unmapfolio.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/mm-thp-fix-collapse_files-try_to_unmapfolio.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/mm-thp-fix-collapse_files-try_to_unmapfolio.patch

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 and is updated
there every 3-4 working days

------------------------------------------------------
From: Hugh Dickins <hughd@google.com>
Subject: mm/thp: fix collapse_file()'s try_to_unmap(folio,)

The foliation of THP collapse_file()'s call to try_to_unmap() is currently
wrong, crashing on a test in rmap_walk() when xas_next() delivered a value
(after which page has been loaded independently).

Link: https://lkml.kernel.org/r/3f187b6c-e5e8-e66d-e0c0-7455ca6abb4c@google.com
Fixes: c3b522d9a698 ("mm/rmap: Convert try_to_unmap() to take a folio")
Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/khugepaged.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/mm/khugepaged.c~mm-thp-fix-collapse_files-try_to_unmapfolio
+++ a/mm/khugepaged.c
@@ -1835,7 +1835,8 @@ static void collapse_file(struct mm_stru
 		}
 
 		if (page_mapped(page))
-			try_to_unmap(folio, TTU_IGNORE_MLOCK | TTU_BATCH_FLUSH);
+			try_to_unmap(page_folio(page),
+				     TTU_IGNORE_MLOCK | TTU_BATCH_FLUSH);
 
 		xas_lock_irq(&xas);
 		xas_set(&xas, index);
_

Patches currently in -mm which might be from hughd@google.com are

memfd-fix-f_seal_write-after-shmem-huge-page-allocated.patch
tmpfs-support-for-file-creation-time-fix.patch
mm-thp-fix-collapse_files-try_to_unmapfolio.patch
mm-migrate-fix-remove_migration_pte-of-hugetlb-entry.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-28  5:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28  5:15 + mm-thp-fix-collapse_files-try_to_unmapfolio.patch added to -mm tree Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).