memcg: fix direct softlimit reclaim to be called in limit path
Michal Hocko
Reviewed-byI am sorry, that I am answering that late but I didn't get to this sooner.
Quoted 13 lines · Andrew Morton
From: KAMEZAWA Hiroyuki <[email protected]>
commit d149e3b ("memcg: add the
soft_limitreclaim in global direct reclaim") adds a softlimit hook toshrink_zones(). By this, soft limit is called astry_to_free_pages() do_try_to_free_pages() shrink_zones() mem_cgroup_soft_limit_reclaim()Then, direct reclaim is memcg softlimit hint aware, now.
Quoted 8 lines
But, the memory cgroup's "limit" path can call softlimit shrinker.
try_to_free_mem_cgroup_pages() do_try_to_free_pages() shrink_zones() mem_cgroup_soft_limit_reclaim()This will cause a global reclaim when a memcg hits limit.
Sorry, I do not get it. How does it cause the global reclaim? Did you mean soft reclaim?
Quoted 3 lines
This is bug.
soft_limit_reclaim()should be called whenscanning_global_lru(sc)== true.
Agreed
Quoted 6 lines
And the commit adds a variable "
total_scanned" for counting softlimit scanned pages....it's not "total". This patch removes the variable and updatesc->nr_scannedinstead of it. This will affect shrink_slab()'s scan condition but, global LRU is scanned by softlimit and I think this change makes sense.
Yes, the previous semantic was really confusing (part of the scanned accounting is returned by shrink_zones and the other part in sc). This could be ideally a separate change because it fixes a different bug (softlimit is not considered for slab srhinking)
Quoted 8 lines
TODO: avoid too much scanning of a zone when softlimit did enough work.
Signed-off-by KAMEZAWA Hiroyuki <[email protected]>Cc Daisuke Nishimura <[email protected]>Cc Ying Han <[email protected]>Cc Michal Hocko <[email protected]>Signed-off-by Andrew Morton <[email protected]>
Just in case it is not late yet.
Signature · 13 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 24 lines · On Tue, 28 Jun 2011 10:08:47 +0200 Michal Hocko <[email protected]> wrote:
I am sorry, that I am answering that late but I didn't get to this sooner.
Quoted 20 lines · Andrew Morton
From: KAMEZAWA Hiroyuki <[email protected]>
commit d149e3b ("memcg: add the
soft_limitreclaim in global direct reclaim") adds a softlimit hook toshrink_zones(). By this, soft limit is called astry_to_free_pages() do_try_to_free_pages() shrink_zones() mem_cgroup_soft_limit_reclaim()Then, direct reclaim is memcg softlimit hint aware, now.
But, the memory cgroup's "limit" path can call softlimit shrinker.
try_to_free_mem_cgroup_pages() do_try_to_free_pages() shrink_zones() mem_cgroup_soft_limit_reclaim()
Quoted 5 lines
Quoted 1 line
This will cause a global reclaim when a memcg hits limit.
Sorry, I do not get it. How does it cause the global reclaim? Did you mean soft reclaim?
yes. soft reclaim does global reclaim (in some means).
Thanks,
-Kame
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 27 lines · KAMEZAWA Hiroyuki
Quoted 24 lines · On Tue, 28 Jun 2011 10:08:47 +0200 Michal Hocko <[email protected]> wrote:
I am sorry, that I am answering that late but I didn't get to this sooner.
Quoted 20 lines · Andrew Morton
From: KAMEZAWA Hiroyuki <[email protected]>
commit d149e3b ("memcg: add the
soft_limitreclaim in global direct reclaim") adds a softlimit hook toshrink_zones(). By this, soft limit is called astry_to_free_pages() do_try_to_free_pages() shrink_zones() mem_cgroup_soft_limit_reclaim()Then, direct reclaim is memcg softlimit hint aware, now.
But, the memory cgroup's "limit" path can call softlimit shrinker.
try_to_free_mem_cgroup_pages() do_try_to_free_pages() shrink_zones() mem_cgroup_soft_limit_reclaim()
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
This will cause a global reclaim when a memcg hits limit.
Sorry, I do not get it. How does it cause the global reclaim? Did you mean soft reclaim?
yes. soft reclaim does global reclaim (in some means).
But calling it global reclaim is rather confusing because in both paths we have sc.mem_cgroup set to non-NULL which is evaluated as !scanning_global_lru(sc). Anyway, this is not that important, I just wanted to be sure what you meant by that comment.
Signature · 13 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>