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]
Date:	Tue, 25 Oct 2011 23:21:43 -0700 (PDT)
From:	David Rientjes <rientjes@...gle.com>
To:	Eial Czerwacki <eial@...lemp.com>
cc:	linux-kernel@...r.kernel.org,
	"Shai Fultheim (Shai@...leMP.com)" <Shai@...lemp.com>
Subject: Re: [PATCH] APICID: Avoid false sharing on the read mostly
 x86_cpu_to_apicid

On Tue, 25 Oct 2011, Eial Czerwacki wrote:

> Avoid false sharing on the read mostly x86_cpu_to_apicid by moving it to
> __read_mostly section.

x86_cpu_to_apicid used to be in .init.data and now it's never freed after 
boot?

> The per-cpu area is write and read and this symbol shows up high on ipi
> intensive/x86_cpu_to_apicid load.
> 
> Signed-off-by: Eial Czerwacki<eial@...lemp.com>
> Signed-off-by: Shai Fultheim<shai@...lemp.com>
> Author: Ravikiran Thirumalai<kiran@...lex86.org>

If the author isn't you, then the patch should start with a single line 
that says "From: name <email>" of the author followed by a blank line.  
It's also strange that the author doesn't have a sign-off line.

Your email client also has corrupted the inline patch, please see 
Documentation/email-clients.txt.

And, finally, please send this to the x86 maintainers once fixed.  See 
./scripts/get_maintainers.pl <your patch>.

> Index: b/arch/x86/include/asm/smp.h
> ===================================================================
> --- a/arch/x86/include/asm/smp.h	2010-06-01 09:56:03.000000000 -0700
> +++ b/arch/x86/include/asm/smp.h	2010-06-02 15:59:21.000000000 -0700
> @@ -36,7 +36,8 @@ static inline struct cpumask *cpu_core_m
>   	return per_cpu(cpu_core_map, cpu);
>   }
> 
> -DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid);
> +extern u16 x86_cpu_to_apicid[NR_CPUS];
> +
>   DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid);
> 
>   /* Static state in head.S used to set up a CPU */
> @@ -142,7 +143,7 @@ void native_send_call_func_ipi(const str
>   void native_send_call_func_single_ipi(int cpu);
> 
>   void smp_store_cpu_info(int id);
> -#define cpu_physical_id(cpu)	per_cpu(x86_cpu_to_apicid, cpu)
> +#define cpu_physical_id(cpu)	x86_cpu_to_apicid[cpu]
> 
>   /* We don't mark CPUs online until __cpu_up(), so we need another measure */
>   static inline int num_booting_cpus(void)
> Index: b/arch/x86/kernel/acpi/boot.c
> ===================================================================
> --- a/arch/x86/kernel/acpi/boot.c	2010-06-01 09:56:03.000000000 -0700
> +++ b/arch/x86/kernel/acpi/boot.c	2010-06-02 15:59:21.000000000 -0700
> @@ -568,7 +568,7 @@ EXPORT_SYMBOL(acpi_map_lsapic);
> 
>   int acpi_unmap_lsapic(int cpu)
>   {
> -	per_cpu(x86_cpu_to_apicid, cpu) = -1;
> +	x86_cpu_to_apicid[cpu] = -1;
>   	set_cpu_present(cpu, false);
>   	num_processors--;
> 

Shouldn't this be BAD_APICID?  Not sure where we check for -1.
--
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