Re: [PATCH] rcu: add __cpuinit to rcu_init_percpu_data()

From: Paul E. McKenney
Date: Wed Jan 14 2009 - 11:14:41 EST


On Wed, Jan 14, 2009 at 02:58:15PM +0800, Lai Jiangshan wrote:
>
> Impact: rcu_init_percpu_data() is not use after boot when !CONFIG_HOTPLUG_CPU
>
> add __cpuinit to rcu_init_percpu_data(), and this function's text
> will be discarded after boot when !CONFIG_HOTPLUG_CPU.

Good catch!!!

Acked-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>

> Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
> ---
> diff --git a/kernel/rcuclassic.c b/kernel/rcuclassic.c
> index 490934f..bd5a900 100644
> --- a/kernel/rcuclassic.c
> +++ b/kernel/rcuclassic.c
> @@ -716,7 +716,7 @@ void rcu_check_callbacks(int cpu, int user)
> raise_rcu_softirq();
> }
>
> -static void rcu_init_percpu_data(int cpu, struct rcu_ctrlblk *rcp,
> +static void __cpuinit rcu_init_percpu_data(int cpu, struct rcu_ctrlblk *rcp,
> struct rcu_data *rdp)
> {
> unsigned long flags;
> diff --git a/kernel/rcutree.c b/kernel/rcutree.c
> index f2d8638..b2fd602 100644
> --- a/kernel/rcutree.c
> +++ b/kernel/rcutree.c
> @@ -1314,7 +1314,7 @@ int rcu_needs_cpu(int cpu)
> * access due to the fact that this CPU cannot possibly have any RCU
> * callbacks in flight yet.
> */
> -static void
> +static void __cpuinit
> rcu_init_percpu_data(int cpu, struct rcu_state *rsp)
> {
> unsigned long flags;
>
>
>
--
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/