All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Eial Czerwacki <eial@scalemp.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 01:20:26 -0700	[thread overview]
Message-ID: <m2fwigw4dx.fsf@firstfloor.org> (raw)
In-Reply-To: <4EA6A265.1080506@scalemp.com> (Eial Czerwacki's message of "Tue, 25 Oct 2011 13:49:57 +0200")

Eial Czerwacki <eial@scalemp.com> writes:

> ===================================================================
> --- 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];

That's a big waste of memory. On a CONFIG_MAX_SMP kernel compiled for
4096 CPUs you're wasting 8k now on smaller systems. The per cpu
data only allocates what is needed.

NR_CPUS is usually a bad idea and it 

Perhaps need a __read_mostly cache line padded per CPU section instead
for cases like this.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only

      parent reply	other threads:[~2011-10-26  8:20 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   ` [PATCH] APICID: Avoid false sharing on the read mostly x86_cpu_to_apicid Eial Czerwacki
2011-10-26  6:21     ` David Rientjes
2011-10-26  6:41       ` Eial Czerwacki
2011-10-26  6:47         ` David Rientjes
2011-10-26  7:01           ` Eial Czerwacki
2011-10-26  8:20     ` Andi Kleen [this message]

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=m2fwigw4dx.fsf@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=Shai@scalemp.com \
    --cc=eial@scalemp.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.