lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1291815501.2883.34.camel@edumazet-laptop>
Date:	Wed, 08 Dec 2010 14:38:21 +0100
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	Christoph Lameter <cl@...ux.com>, akpm@...ux-foundation.org,
	Yinghai Lu <yinghai@...nel.org>, Ingo Molnar <mingo@...e.hu>,
	Pekka Enberg <penberg@...helsinki.fi>,
	linux-kernel@...r.kernel.org,
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [PATCH] x86: Replace uses of current_cpu_data with this_cpu ops

Le mercredi 08 décembre 2010 à 14:16 +0100, Tejun Heo a écrit :
> From 9e9b27bff0e2441512ec27d3a90b252ecdc6ec3e Mon Sep 17 00:00:00 2001
> From: Christoph Lameter <cl@...ux.com>
> Date: Wed, 8 Dec 2010 14:11:07 +0100
> 
> Replace all uses of current_cpu_data with this_cpu operations on the
> per cpu structure cpu_info.  The scala accesses are replaced with the
> matching this_cpu ops which results in smaller and more efficient
> code.
> 
> In the long run, it might be a good idea to remove cpu_data() macro
> too and use per_cpu macro directly.
> 

or introduce this_cpu_has() to remove the adress computation

-	if (cpu_has(__this_cpu_ptr(&cpu_info), X86_FEATURE_ARAT)) {

+	if (this_cpu_has(X86_FEATURE_ARAT)) {

> tj: updated description
> 
> Cc: Yinghai Lu <yinghai@...nel.org>
> Cc: Ingo Molnar <mingo@...e.hu>
> Signed-off-by: Christoph Lameter <cl@...ux.com>
> Signed-off-by: Tejun Heo <tj@...nel.org>
> ---
> Comitted with updated description.  Thanks.
> 
>  arch/x86/include/asm/processor.h          |    3 +--
>  arch/x86/kernel/apic/apic.c               |    2 +-
>  arch/x86/kernel/cpu/amd.c                 |    2 +-
>  arch/x86/kernel/cpu/cpufreq/powernow-k8.c |    2 +-
>  arch/x86/kernel/cpu/intel_cacheinfo.c     |    4 ++--
>  arch/x86/kernel/cpu/mcheck/mce.c          |   14 +++++++-------
>  arch/x86/kernel/cpu/mcheck/mce_intel.c    |    2 +-
>  arch/x86/kernel/process.c                 |    4 ++--
>  arch/x86/kernel/smpboot.c                 |   12 ++++++------
>  arch/x86/oprofile/op_model_ppro.c         |    8 ++++----
>  drivers/staging/lirc/lirc_serial.c        |    4 ++--
>  11 files changed, 28 insertions(+), 29 deletions(-)
> 
> diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
> index cae9c3c..c6efecf 100644
> --- a/arch/x86/include/asm/processor.h
> +++ b/arch/x86/include/asm/processor.h
> @@ -141,10 +141,9 @@ extern __u32			cpu_caps_set[NCAPINTS];
>  #ifdef CONFIG_SMP
>  DECLARE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info);
>  #define cpu_data(cpu)		per_cpu(cpu_info, cpu)
> -#define current_cpu_data	__get_cpu_var(cpu_info)
>  #else
> +#define cpu_info		boot_cpu_data
>  #define cpu_data(cpu)		boot_cpu_data
> -#define current_cpu_data	boot_cpu_data
>  #endif
> 
>  extern const struct seq_operations cpuinfo_op;
> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
> index 3f838d5..8accfe3 100644
> --- a/arch/x86/kernel/apic/apic.c
> +++ b/arch/x86/kernel/apic/apic.c
> @@ -516,7 +516,7 @@ static void __cpuinit setup_APIC_timer(void)
>  {
>  	struct clock_event_device *levt = &__get_cpu_var(lapic_events);
> 
> -	if (cpu_has(&current_cpu_data, X86_FEATURE_ARAT)) {
> +	if (cpu_has(__this_cpu_ptr(&cpu_info), X86_FEATURE_ARAT)) {
>  		lapic_clockevent.features &= ~CLOCK_EVT_FEAT_C3STOP;
>  		/* Make LAPIC timer preferrable over percpu HPET */
>  		lapic_clockevent.rating = 150;

...


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ