public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jesse.barnes@intel.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [RFC] pcibus_to_node implementation for ia64
Date: Wed, 11 May 2005 15:29:37 +0000	[thread overview]
Message-ID: <200505110829.37451.jesse.barnes@intel.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0505051707220.6114@schroedinger.engr.sgi.com>

On Tuesday, May 10, 2005 7:42 pm, colin ngam wrote:
> This is the correct result - with respect to which node the
> bus/device/function is directly connected.

Not really, since the kernel is only aware of nodes (for most purposes) 
that actually have memory.  If the I/O and memoryless nodes were listed 
in the SLIT and SRAT tables, this would be the case (the kernel would 
build empty node structures for those nodes), but it's not at the 
moment.

> Either than using this 
> function in pcibus_to_cpumask(), what other purpose is this routine
> targeted?

You mean 'other than pcibus_to_cpumask'?  The idea is to use it for 
memory allocation in device drivers, as well as the obvious use in the 
actual DMA mapping layer (e.g. pci_alloc_consistent).  It could also be 
used to simplify the interrupt targetting code a little, iirc, assuming 
the above condition was met (that is, that all nodes, regardless of 
configuration, had pgdat structures associated with them).

> Depending on what you want, you have to test the node id to see if it
> contains memory or if it contains cpus or both.

That's certainly another way to go--just make the function do a search 
to find the closest node with memory (and/or CPUs) all by itself.  The 
obvious disadvantage is that you'll incur that cost on every function 
call unless you build a lookup table at boot time or somesuch.

> There is always a node associated with the device - the issue is that
> the node may not have cpu but has memory, or may not have both memory
> and cpu.

That's where things get confusing, since 'node' is an overloaded term 
here.  It does *not* return a node that you can pass into 
alloc_pages_node for instance, which I think is what Christoph wants.  
It does, however, return a node id in the cnodeid sense, but one that 
could be useless in most parts of the kernel.

Jesse

  parent reply	other threads:[~2005-05-11 15:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-06  0:12 [RFC] pcibus_to_node implementation for ia64 Christoph Lameter
2005-05-10 23:56 ` colin ngam
2005-05-11  1:34 ` Christoph Lameter
2005-05-11  2:42 ` colin ngam
2005-05-11  6:51 ` Christoph Lameter
2005-05-11 15:29 ` Jesse Barnes [this message]
2005-05-11 15:44 ` colin ngam
2005-05-11 15:49 ` Christoph Lameter
2005-05-11 15:52 ` colin ngam
2005-05-11 15:54 ` Jesse Barnes
2005-05-11 15:58 ` Jesse Barnes
2005-05-11 16:05 ` colin ngam
2005-05-11 16:19 ` Jack Steiner

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=200505110829.37451.jesse.barnes@intel.com \
    --to=jesse.barnes@intel.com \
    --cc=linux-ia64@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox