All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Andreas Herrmann <andreas.herrmann3@amd.com>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>, Ingo Molnar <mingo@elte.hu>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pci: derive nearby CPUs from device's instead of bus' NUMA information
Date: Mon, 20 Apr 2009 13:03:41 -0700	[thread overview]
Message-ID: <20090420130341.098c8ebe@hobbes> (raw)
In-Reply-To: <20090420084747.GA7286@alberich.amd.com>

On Mon, 20 Apr 2009 10:47:47 +0200
Andreas Herrmann <andreas.herrmann3@amd.com> wrote:

> On Fri, Apr 17, 2009 at 12:26:54PM -0700, Yinghai Lu wrote:
> > On Fri, Apr 17, 2009 at 9:21 AM, Ingo Molnar <mingo@elte.hu> wrote:
> > > const struct cpumask * cpumask_of_pcidev(struct pci_dev *dev)
> > > {
> > >        if (dev->numa_node == -1)
> > >                return cpumask_of_pcibus(to_pci_dev(dev)->bus);
> > >
> > >        return cpumask_of_node(dev_to_node(dev));
> > > }
> > >
> > > ? This would work fine in all cases.
> 
> Yes, I think so. That's the general solution w/o additional
> "ifdefing".
> 
> > you are right, dev_to_node(dev) could return -1 on 64bit, if there
> > is no memory on that node.
> 
> Hmm, I thought just in the CONFIG_NUMA=n case -1 is returned.
> 
> During initialization the struct device's numa_node is set to -1 and
> later on the information is inherited from the parent numa_node.
> 
> So what do I miss?

I like the idea of cpumask_of_pcidev(), but it seems like
cpumask_of_pcibus should return the same value.  So if the node is
unassigned or "equadistant" (there's code that treats -1 as both I
think), cpumask_of_pcibus should figure out what the nearest CPUs are
and return that, right?

-- 
Jesse Barnes, Intel Open Source Technology Center

  reply	other threads:[~2009-04-20 20:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-17 10:01 [PATCH] pci: derive nearby CPUs from device's instead of bus' NUMA information Andreas Herrmann
2009-04-17 16:21 ` Ingo Molnar
2009-04-17 19:26   ` Yinghai Lu
2009-04-20  8:47     ` Andreas Herrmann
2009-04-20 20:03       ` Jesse Barnes [this message]
2009-05-07  8:51         ` Andreas Herrmann
2009-05-11 21:54           ` Jesse Barnes
2009-06-09  5:47             ` Andreas Herrmann
2009-04-20 21:23       ` Yinghai Lu
2009-04-21 18:05         ` Andreas Herrmann

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=20090420130341.098c8ebe@hobbes \
    --to=jbarnes@virtuousgeek.org \
    --cc=andreas.herrmann3@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=yhlu.kernel@gmail.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 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.