swapfile: call cond_resched() before locking si->lock
PATCH 1/1 swapfile: call cond_resched() before locking si->lock
The 6.12 backport of commit 66366d291f66 ("mm/swap: add cond_resched() in swap_reclaim_full_clusters to prevent softlockup"), added a cond_resched() after locking si->lock. Move cond_resched() before spin_lock().
Signed-off-by Guillaume Morin <[email protected]>
Fixes 60cbe67d1342 ("mm/swap: add cond_resched() in swap_reclaim_full_clusters to prevent softlockup")
Cc Chris Li <[email protected]>
Cc Zijiang Huang <[email protected]>
--- mm/swapfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/swapfile.c +1 -1
@@ -770,11 +770,11 @@ static void swap_reclaim_full_clusters(struct swap_info_struct *si, bool force) } offset++; } +cond_resched ();spin_lock (&si->lock);if (to_scan <=0 )break ; -cond_resched (); } }
Signature · 5 lines
2.39.1 -- Guillaume Morin <[email protected]>
Quoted 4 lines · Guillaume Morin
The 6.12 backport of commit
66366d291f66("mm/swap: addcond_resched()inswap_reclaim_full_clustersto prevent softlockup"), added acond_resched()after lockingsi->lock. Movecond_resched()beforespin_lock().
Queued for 6.12, thanks.
Signature · 2 lines
Thanks, Sasha