From 7d170856020c6ad96ef4b9dbc24635052587f01f Mon Sep 17 00:00:00 2001 From: Sha Zhengju Date: Fri, 13 Apr 2012 08:52:09 +1000 Subject: [PATCH] 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 --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.39.5