From cd0f658a0f4925248c6bb77bb32ff4f336c9dddd Mon Sep 17 00:00:00 2001 From: Sha Zhengju Date: Thu, 3 May 2012 15:44:00 +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 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 -- 2.39.5