[ltt-dev] [PATCH 02/10] init maxcpus before use it
Mathieu Desnoyers
mathieu.desnoyers at efficios.com
Thu Sep 15 10:59:37 EDT 2011
* Lai Jiangshan (laijs at cn.fujitsu.com) wrote:
> Signed-off-by: Lai Jiangshan <laijs at cn.fujitsu.com>
[ Edit:
Covers the per-cpu call_rcu data setup (not all_cpus helper, which is
why we did not trigger it in our tests. ]
Merged, thanks!
Mathieu
> ---
> urcu-call-rcu-impl.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/urcu-call-rcu-impl.h b/urcu-call-rcu-impl.h
> index 700d128..e0a8fd8 100644
> --- a/urcu-call-rcu-impl.h
> +++ b/urcu-call-rcu-impl.h
> @@ -386,6 +386,7 @@ int set_cpu_call_rcu_data(int cpu, struct call_rcu_data *crdp)
> static int warned = 0;
>
> call_rcu_lock(&call_rcu_mutex);
> + alloc_cpu_call_rcu_data();
> if (cpu < 0 || maxcpus <= cpu) {
> if (!warned) {
> fprintf(stderr, "[error] liburcu: set CPU # out of range\n");
> @@ -395,7 +396,6 @@ int set_cpu_call_rcu_data(int cpu, struct call_rcu_data *crdp)
> errno = EINVAL;
> return -EINVAL;
> }
> - alloc_cpu_call_rcu_data();
> call_rcu_unlock(&call_rcu_mutex);
> if (per_cpu_call_rcu_data == NULL) {
> errno = ENOMEM;
> --
> 1.7.4.4
>
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
More information about the lttng-dev
mailing list