From fad0d02498d8a44f8ba7124d21620621a739e319 Mon Sep 17 00:00:00 2001 From: Sha Zhengju Date: Wed, 25 Apr 2012 11:03:47 +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 ed0d707094d8..9a6d7b87640d 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4675,7 +4675,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