[PATCH 4/6] memcg: fix broken boolean expression
From: Kirill A. Shutemov
Date: Fri Dec 23 2011 - 21:12:53 EST
action != CPU_DEAD || action != CPU_DEAD_FROZEN is always true.
We should return at the point if CPU doesn't go away. Otherwise drain
all counters and stocks from the CPU.
Signed-off-by: Kirill A. Shutemov <kirill@xxxxxxxxxxxxx>
Cc: <stable@xxxxxxxxxx>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
Acked-by: Michal Hocko <mhocko@xxxxxxx>
---
mm/memcontrol.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 4ed6737..513ae04 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2095,9 +2095,11 @@ static int __cpuinit memcg_cpu_hotplug_callback(struct notifier_block *nb,
return NOTIFY_OK;
}
- if ((action != CPU_DEAD) || action != CPU_DEAD_FROZEN)
+ if (action != CPU_DEAD && action != CPU_DEAD_FROZEN)
return NOTIFY_OK;
+ /* CPU goes away */
+
for_each_mem_cgroup(iter)
mem_cgroup_drain_pcp_counter(iter, cpu);
--
1.7.8.3
--
Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/