From: Sergey Senozhatsky Date: Fri, 26 Jan 2024 03:25:48 +0000 (+0900) Subject: mm/madvise: don't forget to leave lazy MMU mode in madvise_cold_or_pageout_pte_range() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4c2da3188b848d33c26d7f0f8b14f3150331c923;p=linux.git mm/madvise: don't forget to leave lazy MMU mode in madvise_cold_or_pageout_pte_range() We need to leave lazy MMU mode before unlocking. Link: https://lkml.kernel.org/r/20240126032608.355899-1-senozhatsky@chromium.org Fixes: b2f557a21bc8 ("mm/madvise: add cond_resched() in madvise_cold_or_pageout_pte_range()") Signed-off-by: Sergey Senozhatsky Cc: Jiexun Wang Signed-off-by: Andrew Morton --- diff --git a/mm/madvise.c b/mm/madvise.c index 912155a94ed58..cfa5e72882611 100644 --- a/mm/madvise.c +++ b/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;