The patch titled Subject: mm/madvise: don't forget to leave lazy MMU mode in madvise_cold_or_pageout_pte_range() has been added to the -mm mm-hotfixes-unstable branch. Its filename is mm-madvise-dont-forget-to-leave-lazy-mmu-mode-in-madvise_cold_or_pageout_pte_range.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-madvise-dont-forget-to-leave-lazy-mmu-mode-in-madvise_cold_or_pageout_pte_range.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: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx> Subject: mm/madvise: don't forget to leave lazy MMU mode in madvise_cold_or_pageout_pte_range() Date: Fri, 26 Jan 2024 12:25:48 +0900 We need to leave lazy MMU mode before unlocking. Link: https://lkml.kernel.org/r/20240126032608.355899-1-senozhatsky@xxxxxxxxxxxx Fixes: b2f557a21bc8 ("mm/madvise: add cond_resched() in madvise_cold_or_pageout_pte_range()") Signed-off-by: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx> Cc: Jiexun Wang <wangjiexun@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/madvise.c | 1 + 1 file changed, 1 insertion(+) --- a/mm/madvise.c~mm-madvise-dont-forget-to-leave-lazy-mmu-mode-in-madvise_cold_or_pageout_pte_range +++ a/mm/madvise.c @@ -429,6 +429,7 @@ restart: if (++batch_count == SWAP_CLUSTER_MAX) { batch_count = 0; if (need_resched()) { + arch_leave_lazy_mmu_mode(); pte_unmap_unlock(start_pte, ptl); cond_resched(); goto restart; _ Patches currently in -mm which might be from senozhatsky@xxxxxxxxxxxx are mm-madvise-dont-forget-to-leave-lazy-mmu-mode-in-madvise_cold_or_pageout_pte_range.patch