From: Sha Zhengju Date: Thu, 3 May 2012 05:44:00 +0000 (+1000) Subject: memcg: revise the position of threshold index while unregistering event X-Git-Tag: next-20120503~2^2~165 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cd0f658a0f4925248c6bb77bb32ff4f336c9dddd;p=karo-tx-linux.git memcg: revise the position of threshold index while unregistering event Index current_threshold should point to threshold just below or equal to usage. See below: http://www.spinics.net/lists/cgroups/msg00844.html Signed-off-by: Sha Zhengju Reviewed-by: Kirill A. Shutemov Cc: KAMEZAWA Hiroyuki Cc: Johannes Weiner Cc: Michal Hocko Signed-off-by: Andrew Morton --- diff --git a/mm/memcontrol.c b/mm/memcontrol.c index c003c9940f5f..bbae7af36cc7 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4695,7 +4695,7 @@ static void mem_cgroup_usage_unregister_event(struct cgroup *cgrp, continue; new->entries[j] = thresholds->primary->entries[i]; - if (new->entries[j].threshold < usage) { + if (new->entries[j].threshold <= usage) { /* * new->current_threshold will not be used * until rcu_assign_pointer(), so it's safe to increment