Commit 8f522b03 authored by Sergey Senozhatsky's avatar Sergey Senozhatsky Committed by Liu Shixin
Browse files

mm/madvise: don't forget to leave lazy MMU mode in madvise_cold_or_pageout_pte_range()

mainline inclusion
from mainline-v6.8-rc4
commit 4c2da3188b848d33c26d7f0f8b14f3150331c923
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9OCYO
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4c2da3188b848d33c26d7f0f8b14f3150331c923

--------------------------------

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: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
Cc: Jiexun Wang <wangjiexun@tinylab.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
parent 4ecfeff5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -473,6 +473,7 @@ static int madvise_cold_or_pageout_pte_range(pmd_t *pmd,
		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;