lkml.org 
[lkml]   [2009]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -tip/core/rcu 2/6] Introduce cpu_notifier() to handle !HOTPLUG_CPU case
From
Date
On Sat, 2009-08-15 at 09:53 -0700, Paul E. McKenney wrote:
> From: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> This patch introduces a new cpu_notifier() API that is similar to
> hotcpu_notifier(), but which also notifies of CPUs coming online during
> boot in the !HOTPLUG_CPU case.
[...]
> --- a/include/linux/cpu.h
> +++ b/include/linux/cpu.h
> @@ -48,6 +48,15 @@ struct notifier_block;
>
> #ifdef CONFIG_SMP
> /* Need to know about CPUs going up/down? */
> +#if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE)
> +#define cpu_notifier(fn, pri) { \
> + static struct notifier_block fn##_nb __cpuinitdata = \
> + { .notifier_call = fn, .priority = pri }; \
> + register_cpu_notifier(&fn##_nb); \
> +}
> +#else /* #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) */
> +#define cpu_notifier(fn, pri) do { (void)(fn); } while (0)
> +#endif /* #else #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) */

These two definitions seem inconsistent. I think the first one needs to
change to use do { ... } while(0) as well, so it eats the subsequent
semicolon.

Does this really want to live under defined(CONFIG_HOTPLUG_CPU)? What
happens when onlining CPUs during the !define(CONFIG_HOTPLUG_CPU) case?
This seems somewhat inconsistent with the explanation in your commit
message; can you clarify?

Also, why !defined(MODULE)?

- Josh Triplett



\
 
 \ /
  Last update: 2009-08-17 19:25    [W:0.111 / U:1.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site