Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
mm/madvise: don't forget to leave lazy MMU mode in madvise_cold_or_pa…
Browse files Browse the repository at this point in the history
…geout_pte_range()

We need to leave lazy MMU mode before unlocking.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: b2f557a ("mm/madvise: add cond_resched() in madvise_cold_or_pageout_pte_range()")
Signed-off-by: Sergey Senozhatsky <[email protected]>
Cc: Jiexun Wang <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
sergey-senozhatsky authored and akpm00 committed Feb 8, 2024
1 parent e870920 commit 4c2da31
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/madvise.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,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;
Expand Down

0 comments on commit 4c2da31

Please sign in to comment.