* [PATCH] mm, vmscan: Make kswapd reclaim no more than needed
@ 2016-06-24 8:59 Hillf Danton
2016-06-24 9:32 ` Mel Gorman
0 siblings, 1 reply; 2+ messages in thread
From: Hillf Danton @ 2016-06-24 8:59 UTC (permalink / raw)
To: 'Mel Gorman'
Cc: 'Johannes Weiner', 'Vlastimil Babka',
'linux-kernel', linux-mm, Andrew Morton
We stop reclaiming pages if any eligible zone is balanced.
Signed-off-by: Hillf Danton <hillf.zj@alibaba-inc.com>
---
--- a/mm/vmscan.c Thu Jun 23 17:56:34 2016
+++ b/mm/vmscan.c Fri Jun 24 16:45:58 2016
@@ -3185,15 +3185,10 @@ static int balance_pgdat(pg_data_t *pgda
if (!populated_zone(zone))
continue;
- if (!zone_balanced(zone, sc.order, classzone_idx)) {
- classzone_idx = i;
- break;
- }
+ if (zone_balanced(zone, sc.order, classzone_idx))
+ goto out;
}
- if (i < 0)
- goto out;
-
/*
* Do some background aging of the anon list, to give
* pages a chance to be referenced before reclaiming. All
@@ -3236,19 +3231,6 @@ static int balance_pgdat(pg_data_t *pgda
/* Check if kswapd should be suspending */
if (try_to_freeze() || kthread_should_stop())
break;
-
- /*
- * Stop reclaiming if any eligible zone is balanced and clear
- * node writeback or congested.
- */
- for (i = 0; i <= classzone_idx; i++) {
- zone = pgdat->node_zones + i;
- if (!populated_zone(zone))
- continue;
-
- if (zone_balanced(zone, sc.order, classzone_idx))
- goto out;
- }
/*
* Raise priority if scanning rate is too low or there was no
--
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mm, vmscan: Make kswapd reclaim no more than needed
2016-06-24 8:59 [PATCH] mm, vmscan: Make kswapd reclaim no more than needed Hillf Danton
@ 2016-06-24 9:32 ` Mel Gorman
0 siblings, 0 replies; 2+ messages in thread
From: Mel Gorman @ 2016-06-24 9:32 UTC (permalink / raw)
To: Hillf Danton
Cc: 'Johannes Weiner', 'Vlastimil Babka',
'linux-kernel', linux-mm, Andrew Morton
On Fri, Jun 24, 2016 at 04:59:55PM +0800, Hillf Danton wrote:
> We stop reclaiming pages if any eligible zone is balanced.
>
> Signed-off-by: Hillf Danton <hillf.zj@alibaba-inc.com>
wakeup_kswapd avoids waking kswapd in the first place if there are balanced
zones. The current code will do at least one reclaim pass if the situation
changes between the wakeup request and kswapd actually waking so some
progress will be made. The risk for strict enforcement is that small low
zones like DMA will be quickly generally balanced but only for very short
periods of time and kswapd will fall behind. It *shouldn't* matter as
the pages allocated from DMA will remain resident until the full node
LRU cycles through but it's a possibility.
I'll test the patch and make sure kswapd still reclaims at the correct
rate. Did you this test yourself with any reclaim intensive workload to
see if kswapd fell behind forcing more stalls in direct reclaim?
--
Mel Gorman
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-06-24 9:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-24 8:59 [PATCH] mm, vmscan: Make kswapd reclaim no more than needed Hillf Danton
2016-06-24 9:32 ` Mel Gorman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).