Re: [PATCH] Correct nr_processes() when CPUs have been unplugged

From: Ingo Molnar
Date: Tue Nov 03 2009 - 11:08:30 EST



* Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:

> I'm not 100% convinced that the per_cpu regions remain valid for
> offline CPUs, although my testing suggests that they do. If not then I
> think the correct solution would be to aggregate the process_count for
> a given CPU into a global base value in cpu_down().

Sidenote: percpu areas currently are kept allocated on x86.

That might change in the future though, especially with virtual systems
where the possible range of CPUs can be very high - without us
necessarily wanting to pay the percpu area allocation price for it. I.e.
dynamic deallocation of percpu areas is something that could happen in
the future.

> This bug appears to pre-date the transition to git and it looks like
> it may even have been present in linux-2.6.0-test7-bk3 since it looks
> like the code Rusty patched in http://lwn.net/Articles/64773/ was
> already wrong.

Nice one. I'm wondering why it was not discovered for such a long time.
That count can go out of sync easily, and we frequently offline cpus
during suspend/resume, and /proc lookup failures will be noticed in
general. How come nobody ran into this? And i'm wondering how you have
run into this - running cpu hotplug stress-tests with Xen guests - or
via pure code review?

Ingo
--
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/