Re: [Use cpuops V1 04/11] x86: Use this_cpu_ops for current_cpu_dataaccesses

From: Tejun Heo
Date: Tue Dec 07 2010 - 09:21:51 EST


On 12/07/2010 03:17 PM, Tejun Heo wrote:
> On 12/06/2010 06:16 PM, Christoph Lameter wrote:
>> Current_cpu_data accesses are per cpu accesses. We can also use
>> this_cpu_ops if a scalar is retrieved.
>>
>> Cc: Yinghai Lu <yinghai@xxxxxxxxxx>
>> Cc: Ingo Molnar <mingo@xxxxxxx>
>> Signed-off-by: Christoph Lameter <cl@xxxxxxxxx>
>>
>> ---
>> arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 2 +-
>> arch/x86/kernel/cpu/intel_cacheinfo.c | 4 ++--
>> arch/x86/kernel/smpboot.c | 10 +++++-----
>> 3 files changed, 8 insertions(+), 8 deletions(-)
>>
>> Index: linux-2.6/arch/x86/kernel/smpboot.c
>> ===================================================================
>> --- linux-2.6.orig/arch/x86/kernel/smpboot.c 2010-11-30 11:53:03.000000000 -0600
>> +++ linux-2.6/arch/x86/kernel/smpboot.c 2010-11-30 11:57:02.000000000 -0600
>> @@ -430,7 +430,7 @@ void __cpuinit set_cpu_sibling_map(int c
>>
>> cpumask_set_cpu(cpu, c->llc_shared_map);
>>
>> - if (current_cpu_data.x86_max_cores == 1) {
>> + if (__this_cpu_read(cpu_info.x86_max_cores) == 1) {
>> cpumask_copy(cpu_core_mask(cpu), cpu_sibling_mask(cpu));
>> c->booted_cores = 1;
>> return;
>> @@ -1377,7 +1377,7 @@ void play_dead_common(void)
>>
>> mb();
>> /* Ack it */
>> - __get_cpu_var(cpu_state) = CPU_DEAD;
>> + __this_cpu_write(cpu_state, CPU_DEAD);
>
> This belongs to the previous patch, right? I'll move it over and
> apply 03 and 04. I think routing these through percpu is okay but if
> anyone wants these to go through x86, scream.

Ooh, was too fast. I think mixing the use of percpu accesses to
cpu_info and the wrapper macro current_cpu_data is quite confusing.
There aren't too many current_cpu_data users in x86 anyway. Can you
please make the conversion complete? I'm moving the above misplaced
chunk into 03 and not applying 04 for now.

Thank you.

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