The patch titled Subject: mm-vmscan-avoid-split-lazyfree-thp-during-shrink_folio_list-fix has been added to the -mm mm-unstable branch. Its filename is mm-vmscan-avoid-split-lazyfree-thp-during-shrink_folio_list-fix.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-vmscan-avoid-split-lazyfree-thp-during-shrink_folio_list-fix.patch This patch will later appear in the mm-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: Lance Yang <ioworker0@xxxxxxxxx> Subject: mm-vmscan-avoid-split-lazyfree-thp-during-shrink_folio_list-fix Date: Sat, 22 Jun 2024 18:00:57 +0800 minor changes suggested by David (https://lore.kernel.org/linux-mm/e7c0aff1-b690-4926-9a34-4e32c9f3faaa@xxxxxxxxxx/) Lance Link: https://lkml.kernel.org/r/20240622100057.3352-1-ioworker0@xxxxxxxxx Signed-off-by: Lance Yang <ioworker0@xxxxxxxxx> Cc: Bang Li <libang.li@xxxxxxxxxxxx> Cc: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx> Cc: Barry Song <baohua@xxxxxxxxxx> Cc: David Hildenbrand <david@xxxxxxxxxx> Cc: Fangrui Song <maskray@xxxxxxxxxx> Cc: Jeff Xie <xiehuan09@xxxxxxxxx> Cc: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx> Cc: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: Minchan Kim <minchan@xxxxxxxxxx> Cc: Muchun Song <songmuchun@xxxxxxxxxxxxx> Cc: Peter Xu <peterx@xxxxxxxxxx> Cc: Ryan Roberts <ryan.roberts@xxxxxxx> Cc: SeongJae Park <sj@xxxxxxxxxx> Cc: Yang Shi <shy828301@xxxxxxxxx> Cc: Yin Fengwei <fengwei.yin@xxxxxxxxx> Cc: Zach O'Keefe <zokeefe@xxxxxxxxxx> Cc: Zi Yan <ziy@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/huge_memory.c | 10 ---------- mm/rmap.c | 5 ++--- 2 files changed, 2 insertions(+), 13 deletions(-) --- a/mm/huge_memory.c~mm-vmscan-avoid-split-lazyfree-thp-during-shrink_folio_list-fix +++ a/mm/huge_memory.c @@ -2693,21 +2693,11 @@ static bool __discard_anon_folio_pmd_loc unsigned long addr, pmd_t *pmdp, struct folio *folio) { - VM_WARN_ON_FOLIO(folio_test_swapbacked(folio), folio); - VM_WARN_ON_FOLIO(!folio_test_anon(folio), folio); - struct mm_struct *mm = vma->vm_mm; int ref_count, map_count; pmd_t orig_pmd = *pmdp; struct page *page; - if (unlikely(!pmd_present(orig_pmd) || !pmd_trans_huge(orig_pmd))) - return false; - - page = pmd_page(orig_pmd); - if (unlikely(page_folio(page) != folio)) - return false; - if (folio_test_dirty(folio) || pmd_dirty(orig_pmd)) return false; --- a/mm/rmap.c~mm-vmscan-avoid-split-lazyfree-thp-during-shrink_folio_list-fix +++ a/mm/rmap.c @@ -1685,9 +1685,8 @@ static bool try_to_unmap_one(struct foli if (flags & TTU_SPLIT_HUGE_PMD) { /* - * We temporarily have to drop the PTL and start - * once again from that now-PTE-mapped page - * table. + * We temporarily have to drop the PTL and + * restart so we can process the PTE-mapped THP. */ split_huge_pmd_locked(vma, pvmw.address, pvmw.pmd, false, folio); _ Patches currently in -mm which might be from ioworker0@xxxxxxxxx are mm-rmap-remove-duplicated-exit-code-in-pagewalk-loop.patch mm-rmap-integrate-pmd-mapped-folio-splitting-into-pagewalk-loop.patch mm-vmscan-avoid-split-lazyfree-thp-during-shrink_folio_list.patch mm-vmscan-avoid-split-lazyfree-thp-during-shrink_folio_list-fix.patch mm-mlock-implement-folio_mlock_step-using-folio_pte_batch.patch