From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756245Ab0K3TI5 (ORCPT ); Tue, 30 Nov 2010 14:08:57 -0500 Received: from smtp104.prem.mail.ac4.yahoo.com ([76.13.13.43]:41381 "HELO smtp104.prem.mail.ac4.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1756003Ab0K3TIv (ORCPT ); Tue, 30 Nov 2010 14:08:51 -0500 X-Yahoo-SMTP: _Dag8S.swBC1p4FJKLCXbs8NQzyse1SYSgnAbY0- X-YMail-OSG: Te6sC_QVM1kJ..xug5BsVp6Kipus4wpH94YhfNduJnmBcXR WSQW5eaGOVSFqdTLPPqPtptrLlI3q_nWYe9j5mHYF6DIiWHNIwZpXQBZCa4L 6H3jkF6ZgwrOv8tIRKmkstjiJAJOJjnIQrPkltSB87LbgURufZKFHnmNqAJV OGkNkGW1gwjAfxgPOaze3DxEnAQtloTvcreYXhyuKUfQwXGhqSsgLbUn6gF6 JeOjTewohNZ_J8hMFUls.r_v3YTcxwwN7_0mYSBhMYoBqa.QFvg-- X-Yahoo-Newman-Property: ymail-3 Message-Id: <20101130190847.543945676@linux.com> User-Agent: quilt/0.48-1 Date: Tue, 30 Nov 2010 13:07:18 -0600 From: Christoph Lameter To: akpm@linux-foundation.org Cc: Pekka Enberg , Yinghai Lu , Ingo Molnar Cc: linux-kernel@vger.kernel.org Cc: Eric Dumazet Cc: Mathieu Desnoyers Cc: Tejun Heo Cc: linux-mm@kvack.org Subject: [thisops uV3 11/18] x86: Use this_cpu_ops for current_cpu_data accesses References: <20101130190707.457099608@linux.com> Content-Disposition: inline; filename=x86_current_cpu_data Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Current_cpu_data accesses are per cpu accesses. We can also use this_cpu_ops if a scalar is retrieved. Cc: Yinghai Lu Cc: Ingo Molnar Signed-off-by: Christoph Lameter --- 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); /* * With physical CPU hotplug, we should halt the cpu @@ -1401,7 +1401,7 @@ static inline void mwait_play_dead(void) return; if (!cpu_has(¤t_cpu_data, X86_FEATURE_CLFLSH)) return; - if (current_cpu_data.cpuid_level < CPUID_MWAIT_LEAF) + if (__this_cpu_read(cpu_info.cpuid_level) < CPUID_MWAIT_LEAF) return; eax = CPUID_MWAIT_LEAF; @@ -1452,7 +1452,7 @@ static inline void mwait_play_dead(void) static inline void hlt_play_dead(void) { - if (current_cpu_data.x86 >= 4) + if (__this_cpu_read(cpu_info.x86) >= 4) wbinvd(); while (1) { Index: linux-2.6/arch/x86/kernel/cpu/cpufreq/powernow-k8.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/cpu/cpufreq/powernow-k8.c 2010-11-30 11:53:03.000000000 -0600 +++ linux-2.6/arch/x86/kernel/cpu/cpufreq/powernow-k8.c 2010-11-30 11:53:33.000000000 -0600 @@ -521,7 +521,7 @@ static void check_supported_cpu(void *_r *rc = -ENODEV; - if (current_cpu_data.x86_vendor != X86_VENDOR_AMD) + if (__this_cpu_read(cpu_info.x86_vendor) != X86_VENDOR_AMD) return; eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE); Index: linux-2.6/arch/x86/kernel/cpu/intel_cacheinfo.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/cpu/intel_cacheinfo.c 2010-11-30 11:53:03.000000000 -0600 +++ linux-2.6/arch/x86/kernel/cpu/intel_cacheinfo.c 2010-11-30 11:53:33.000000000 -0600 @@ -266,7 +266,7 @@ amd_cpuid4(int leaf, union _cpuid4_leaf_ line_size = l2.line_size; lines_per_tag = l2.lines_per_tag; /* cpu_data has errata corrections for K7 applied */ - size_in_kb = current_cpu_data.x86_cache_size; + size_in_kb = __this_cpu_read(cpu_info.x86_cache_size); break; case 3: if (!l3.val) @@ -288,7 +288,7 @@ amd_cpuid4(int leaf, union _cpuid4_leaf_ eax->split.type = types[leaf]; eax->split.level = levels[leaf]; eax->split.num_threads_sharing = 0; - eax->split.num_cores_on_die = current_cpu_data.x86_max_cores - 1; + eax->split.num_cores_on_die = __this_cpu_read(cpu_info.x86_max_cores) - 1; if (assoc == 0xffff)