Hi
I mesured some data in this week and I got some interesting data.
Rik patch improve about 30% and my patch improve 20% more.
totally, We got about 50% improvement.
rc6+stream rvr +kosaki
----------------------------------------
avg 274.8004 194.6495 132.7923
std 184.4902365 111.5699478 75.88299814
min 37.523 57.084 52.233
max 588.74 382.376 319.115
So, rik patch and my patch improve perfectly different reclaim aspect.
In general, kernel reclaim processing has several key goals.
(1) if system has droppable cache, system shouldn't happen oom kill.
(2) if system has avaiable swap space, system shouldn't happen oom kill as poosible as.
(3) if system has enough free memory, system shouldn't reclaim any page
at all.
(4) if memory pressure is lite, system shouldn't cause heavy reclaim latency to application.
rik patch improve (3), my (this mail) modification improve (4).
Actually, kswapd background reclaim and direct reclaim have perfectly
different purpose and goal.
background reclaim
- kswapd don't need latency overhead reducing.
it isn't observe from end user.
- kswapd shoudn't only increase free pages, but also should zone balancing.
foreground reclaim
- it used application task context.
- as possible as, it shouldn't increase latency overhead.
- this reclaiming purpose is to make the memory for _own_ taks.
for other tasks memory don't need to concern.
kswap does it.
o remove priority==DEF_PRIORITY condision
o shrink_zones() also should have bailing out feature.
---
mm/vmscan.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: b/mm/vmscan.c
===================================================================
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1469,7 +1469,7 @@ static void shrink_zone(int priority, st
* freeing target can get unreasonably large.
*/
if (sc->nr_reclaimed > sc->swap_cluster_max &&
- priority < DEF_PRIORITY && !current_is_kswapd())
+ !current_is_kswapd())
break;
}
@@ -1534,6 +1534,8 @@ static void shrink_zones(int priority, s
}
shrink_zone(priority, zone, sc);
+ if (sc->nr_reclaimed > sc->swap_cluster_max)
+ break;
}
}