Commit 2cb2f31f authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix overzealous use of online cpu iterators

From: Rusty Russell <rusty@rustcorp.com.au>

The IA64 hotplug CPU merge seems to have included some core changes: in
particular the recalc_bh_state() needs to sum for all (including offline)
cpus, since we don't empty the counters on CPU down.  The totals printed by
/proc/stat (the first loop) should include offline cpus, too (apparently
printing out the per-cpu lines for offline cpus confuses top).
parent 4a40d604
...@@ -3024,7 +3024,7 @@ static void recalc_bh_state(void) ...@@ -3024,7 +3024,7 @@ static void recalc_bh_state(void)
if (__get_cpu_var(bh_accounting).ratelimit++ < 4096) if (__get_cpu_var(bh_accounting).ratelimit++ < 4096)
return; return;
__get_cpu_var(bh_accounting).ratelimit = 0; __get_cpu_var(bh_accounting).ratelimit = 0;
for_each_online_cpu(i) for_each_cpu(i)
tot += per_cpu(bh_accounting, i).nr; tot += per_cpu(bh_accounting, i).nr;
buffer_heads_over_limit = (tot > max_buffer_heads); buffer_heads_over_limit = (tot > max_buffer_heads);
} }
......
...@@ -368,7 +368,7 @@ int show_stat(struct seq_file *p, void *v) ...@@ -368,7 +368,7 @@ int show_stat(struct seq_file *p, void *v)
if (wall_to_monotonic.tv_nsec) if (wall_to_monotonic.tv_nsec)
--jif; --jif;
for_each_online_cpu(i) { for_each_cpu(i) {
int j; int j;
user += kstat_cpu(i).cpustat.user; user += kstat_cpu(i).cpustat.user;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment