linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: vmscan: fix the kcompactd order wakeuped by kswapd
@ 2023-09-22  4:14 Zhiguo Jiang
  0 siblings, 0 replies; only message in thread
From: Zhiguo Jiang @ 2023-09-22  4:14 UTC (permalink / raw)
  To: Andrew Morton, linux-mm, linux-kernel; +Cc: opensource.kernel, Zhiguo Jiang

When kswapd enters sleep, the situation of reclaim_order < 
alloc_order < pgdat->kswapd_order is possible, so the kcompactd 
order wakeuped by kswapd should take the max value of reclaim_order,
alloc_order and pgdat->kswapd_order.

Signed-off-by: Zhiguo Jiang <justinjiang@vivo.com>
---
 mm/vmscan.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 mm/vmscan.c

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 48c092cc6088..95883bbe2d29
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -6955,6 +6955,7 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int alloc_order, int reclaim_o
 	 * succeed.
 	 */
 	if (prepare_kswapd_sleep(pgdat, reclaim_order, highest_zoneidx)) {
+		int kcompactd_order;
 		/*
 		 * Compaction records what page blocks it recently failed to
 		 * isolate pages from and skips them in the future scanning.
@@ -6967,7 +6968,8 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int alloc_order, int reclaim_o
 		 * We have freed the memory, now we should compact it to make
 		 * allocation of the requested order possible.
 		 */
-		wakeup_kcompactd(pgdat, alloc_order, highest_zoneidx);
+		kcompactd_order = max(alloc_order, pgdat->kswapd_order);
+		wakeup_kcompactd(pgdat, kcompactd_order, highest_zoneidx);
 
 		remaining = schedule_timeout(HZ/10);
 
-- 
2.39.0



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-22  4:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-22  4:14 [PATCH] mm: vmscan: fix the kcompactd order wakeuped by kswapd Zhiguo Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox