mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eial Czerwacki <eial@scalemp.com>
To: David Rientjes <rientjes@google.com>
Cc: linux-kernel@vger.kernel.org,
	"Shai Fultheim (Shai@ScaleMP.com)" <Shai@scalemp.com>
Subject: Re: [PATCH] APICID: Avoid false sharing on the read mostly x86_cpu_to_apicid
Date: Wed, 26 Oct 2011 08:41:00 +0200	[thread overview]
Message-ID: <4EA7AB7C.9080703@scalemp.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1110252318090.20273@chino.kir.corp.google.com>

On 10/26/2011 08:21 AM, David Rientjes wrote:

> 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@scalemp.com>
>> Signed-off-by: Shai Fultheim<shai@scalemp.com>
>> Author: Ravikiran Thirumalai<kiran@scalex86.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.
> 


the author is mentioned after the last sign-off.

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


thanks for the tips, I hope it is ok now.

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


sure.

>> 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@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


I'll check the rest of your comments.

Thanks,

Eial.

  reply	other threads:[~2011-10-26  6:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4EA66960.7050907@scalemp.com>
     [not found] ` <9B14D1490DDECA4E974F6B9FC9EBAB3140CD274367@VMBX108.ihostexchange.net>
2011-10-25 11:49   ` Eial Czerwacki
2011-10-26  6:21     ` David Rientjes
2011-10-26  6:41       ` Eial Czerwacki [this message]
2011-10-26  6:47         ` David Rientjes
2011-10-26  7:01           ` Eial Czerwacki
2011-10-26  8:20     ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EA7AB7C.9080703@scalemp.com \
    --to=eial@scalemp.com \
    --cc=Shai@scalemp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rientjes@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome