Re: [PATCH] [x86, msr]: execute on the correct CPU subset

H. Peter Anvin
2009-07-27T20:47:24Z

Borislav Petkov wrote:
>
> preempt_disable();
> - /*
> - * FIXME: handle the CPU we're executing on separately for now until
> - * smp_call_function_many has been fixed to not skip it.
> - */
> this_cpu = raw_smp_processor_id();
> - smp_call_function_single(this_cpu, __rdmsr_on_cpu, &rv, 1);
>
> - smp_call_function_many(mask, __rdmsr_on_cpu, &rv, 1);
> + if (cpumask_test_cpu(this_cpu, mask))
> + msr_func(&rv);
> +
> + smp_call_function_many(mask, msr_func, &rv, 1);
> preempt_enable();
> }

Any reason not to use get_cpu() ... put_cpu() instead?

-hpa