From: Sha Zhengju Date: Thu, 12 Apr 2012 22:52:09 +0000 (+1000) Subject: memcg: revise the position of threshold index while unregistering event X-Git-Tag: next-20120417~2^2~66 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7d170856020c6ad96ef4b9dbc24635052587f01f;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 d564f1d2567c..7ef75a573b7d 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4470,7 +4470,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