mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yinghai Lu" <yhlu.kernel@gmail.com>
To: "Andi Kleen" <andi@firstfloor.org>
Cc: "Ingo Molnar" <mingo@elte.hu>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Mike Travis" <travis@sgi.com>,
	lameter@sgi.com
Subject: Re: [PATCH] x86_64: remove never used nodenumer in pda
Date: Mon, 18 Feb 2008 12:16:14 -0800	[thread overview]
Message-ID: <86802c440802181216n113a5e66j68d6c9cdd950836d@mail.gmail.com> (raw)
In-Reply-To: <p73ve4mxxlc.fsf@bingen.suse.de>

On Feb 18, 2008 4:23 AM, Andi Kleen <andi@firstfloor.org> wrote:
> Yinghai Lu <Yinghai.Lu@Sun.COM> writes:
>
> > we don't need copy too. already have x86_cpu_to_node_map
>
> That's a regression (probably from Mike's patches?). Until recently it was
> used.
>
> The reason the node number was put in there is that it generates far
> shorter code to just fetch the local node number from the PDA than to
> first go through a array lookup from the cpu number. It also saves a
> costly cache line miss on the array if you're unlucky.
>
> It is far better to fix it than to remove it.
>
> I know Mike/Christoph want to get rid of the PDA and make per cpu data
> as efficient as the PDA. If that happens the right fix is to create
> a new per CPU data variable for the node number again.
>
> Here's a quick patch (tested on kvm with numa emulation only)
>
> It should be ok because PDA is set up early and
> the early node is always 0 and there is a 0 in there
> at early boot.
>
> Saves about 1.6k of text on a vmlinux here.

that is because of the inline...

static inline int early_cpu_to_node(int cpu)
{
        int *cpu_to_node_map = x86_cpu_to_node_map_early_ptr;

        if (cpu_to_node_map)
                return cpu_to_node_map[cpu];
        else if (per_cpu_offset(cpu))
                return per_cpu(x86_cpu_to_node_map, cpu);
        else
                return NUMA_NO_NODE;
}

should use per_cpu(x86_cpu_to_node_map, cpu) instead.
and limited using early_cpu_to_node etc.

YH

  reply	other threads:[~2008-02-18 20:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-17  7:02 Yinghai Lu
2008-02-17 14:03 ` Thomas Gleixner
2008-02-18 12:23 ` Andi Kleen
2008-02-18 20:16   ` Yinghai Lu [this message]
2008-02-19 15:48   ` Mike Travis
2008-02-19 18:08     ` Andi Kleen
2008-02-19 18:32       ` Mike Travis
2008-02-19 20:59         ` Andi Kleen
2008-02-19 21:37           ` Mike Travis

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=86802c440802181216n113a5e66j68d6c9cdd950836d@mail.gmail.com \
    --to=yhlu.kernel@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=lameter@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=travis@sgi.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

all inboxes | Powered by JetHome®