From: kerayhuang <huangzjsmile@gmail.com>
To: kasong@tencent.com, bhe@redhat.com
Cc: linux-mm@kvack.org, kerayhuang <kerayhuang@tencent.com>,
Hao Peng <flyingpeng@tencent.com>
Subject: [PATCH] mm/swap: Add cond_resched() in swap_reclaim_full_clusters to prevent softlockup
Date: Fri, 24 Apr 2026 20:37:23 +0800 [thread overview]
Message-ID: <20260424123723.1820591-1-kerayhuang@tencent.com> (raw)
Add periodic cond_resched() calls during large full_clusters
reclaim operations to prevent softlockup issues.
Signed-off-by: kerayhuang <kerayhuang@tencent.com>
Reviewed-by: Kairui Song <kasong@tencent.com>
Reviewed-by: Hao Peng <flyingpeng@tencent.com>
---
mm/swapfile.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 9174f1eeffb0..74a1e324449d 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1054,6 +1054,7 @@ static void swap_reclaim_full_clusters(struct swap_info_struct *si, bool force)
swap_cluster_unlock(ci);
if (to_scan <= 0)
break;
+ cond_resched();
}
}
--
2.43.5
next reply other threads:[~2026-04-24 12:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-24 12:37 kerayhuang [this message]
2026-04-24 15:39 ` [PATCH] mm/swap: Add cond_resched() in swap_reclaim_full_clusters to prevent softlockup Baoquan He
2026-04-29 12:49 ` kerayhuang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260424123723.1820591-1-kerayhuang@tencent.com \
--to=huangzjsmile@gmail.com \
--cc=bhe@redhat.com \
--cc=flyingpeng@tencent.com \
--cc=kasong@tencent.com \
--cc=kerayhuang@tencent.com \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox