aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorToshi Kani <toshi.kani@hp.com>2013-11-12 18:08:13 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-12 22:09:09 -0500
commit807a1bd2b2a38845fd422b93328e7d69f13eb13a (patch)
tree355479f5a20d1ed71261bd9071583651e5983f4e /mm
parentd7e0b37a87c39f5c02dd7b5d55c7a3ec2f65b943 (diff)
mm: clear N_CPU from node_states at CPU offline
vmstat_cpuup_callback() is a CPU notifier callback, which marks N_CPU to a node at CPU online event. However, it does not update this N_CPU info at CPU offline event. Changed vmstat_cpuup_callback() to clear N_CPU when the last CPU in the node is put into offline, i.e. the node no longer has any online CPU. Signed-off-by: Toshi Kani <toshi.kani@hp.com> Acked-by: Christoph Lameter <cl@linux.com> Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Tested-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/vmstat.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 0a1f7de972b3..b6d17edf8cf3 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1229,6 +1229,20 @@ static void start_cpu_timer(int cpu)
1229 schedule_delayed_work_on(cpu, work, __round_jiffies_relative(HZ, cpu)); 1229 schedule_delayed_work_on(cpu, work, __round_jiffies_relative(HZ, cpu));
1230} 1230}
1231 1231
1232static void vmstat_cpu_dead(int node)
1233{
1234 int cpu;
1235
1236 get_online_cpus();
1237 for_each_online_cpu(cpu)
1238 if (cpu_to_node(cpu) == node)
1239 goto end;
1240
1241 node_clear_state(node, N_CPU);
1242end:
1243 put_online_cpus();
1244}
1245
1232/* 1246/*
1233 * Use the cpu notifier to insure that the thresholds are recalculated 1247 * Use the cpu notifier to insure that the thresholds are recalculated
1234 * when necessary. 1248 * when necessary.
@@ -1258,6 +1272,7 @@ static int vmstat_cpuup_callback(struct notifier_block *nfb,
1258 case CPU_DEAD: 1272 case CPU_DEAD:
1259 case CPU_DEAD_FROZEN: 1273 case CPU_DEAD_FROZEN:
1260 refresh_zone_stat_thresholds(); 1274 refresh_zone_stat_thresholds();
1275 vmstat_cpu_dead(cpu_to_node(cpu));
1261 break; 1276 break;
1262 default: 1277 default:
1263 break; 1278 break;