lkml.org 
[lkml]   [2023]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm: vmscan: fix the kcompactd order wakeuped by kswapd
Date
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
\
 
 \ /
  Last update: 2023-09-22 06:16    [W:0.056 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site