public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* pcibus_to_node value when no pxm info is present for the pci bus
@ 2005-12-07 22:34 Ravikiran G Thirumalai
  2005-12-08 19:05 ` Christoph Lameter
  0 siblings, 1 reply; 8+ messages in thread
From: Ravikiran G Thirumalai @ 2005-12-07 22:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: discuss

Most of the arches seem to return -1 for pcibus_to_node if there is no pxm
kind of proximity information for the pci busses.  Arch specific code on
those arches check if nodeid >= 0  before using the nodeid for kmalloc_node
etc. But some code paths in x86_64/i386 does not doe this --
x86_64/dma_alloc_pages() and e1000 node local descriptor (I am to blame for 
the second one).  Also, pcibus_to_node seems to be 0 when there is no pxm 
info available.

The question is, what should be the default pcibus_to_node if there is no
pxm info? Answer seems like -1 -- in which case dma_alloc_pages and e1000
driver has to be fixed.

Thanks,
Kiran

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: pcibus_to_node value when no pxm info is present for the pci bus
  2005-12-07 22:34 pcibus_to_node value when no pxm info is present for the pci bus Ravikiran G Thirumalai
@ 2005-12-08 19:05 ` Christoph Lameter
  2005-12-08 19:34   ` Ravikiran G Thirumalai
  0 siblings, 1 reply; 8+ messages in thread
From: Christoph Lameter @ 2005-12-08 19:05 UTC (permalink / raw)
  To: Ravikiran G Thirumalai; +Cc: linux-kernel, discuss

On Wed, 7 Dec 2005, Ravikiran G Thirumalai wrote:

> Most of the arches seem to return -1 for pcibus_to_node if there is no pxm
> kind of proximity information for the pci busses.  Arch specific code on
> those arches check if nodeid >= 0  before using the nodeid for kmalloc_node
> etc. But some code paths in x86_64/i386 does not doe this --
> x86_64/dma_alloc_pages() and e1000 node local descriptor (I am to blame for 
> the second one).  Also, pcibus_to_node seems to be 0 when there is no pxm 
> info available.

kmalloc_node falls back to kmalloc for node == -1. So there does not need 
to be a check.
 
> The question is, what should be the default pcibus_to_node if there is no
> pxm info? Answer seems like -1 -- in which case dma_alloc_pages and e1000
> driver has to be fixed.

Why would they have to be fixed?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: pcibus_to_node value when no pxm info is present for the pci bus
  2005-12-08 19:05 ` Christoph Lameter
@ 2005-12-08 19:34   ` Ravikiran G Thirumalai
  2005-12-08 20:04     ` [discuss] " Andi Kleen
  0 siblings, 1 reply; 8+ messages in thread
From: Ravikiran G Thirumalai @ 2005-12-08 19:34 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: linux-kernel, discuss

On Thu, Dec 08, 2005 at 11:05:24AM -0800, Christoph Lameter wrote:
> On Wed, 7 Dec 2005, Ravikiran G Thirumalai wrote:
> 
> > Most of the arches seem to return -1 for pcibus_to_node if there is no pxm
> > kind of proximity information for the pci busses.  Arch specific code on
> > those arches check if nodeid >= 0  before using the nodeid for kmalloc_node
> > etc. But some code paths in x86_64/i386 does not doe this --
> > x86_64/dma_alloc_pages() and e1000 node local descriptor (I am to blame for 
> > the second one).  Also, pcibus_to_node seems to be 0 when there is no pxm 
> > info available.
> 
> kmalloc_node falls back to kmalloc for node == -1. So there does not need 
> to be a check.

Ah! yes,

>  
> > The question is, what should be the default pcibus_to_node if there is no
> > pxm info? Answer seems like -1 -- in which case dma_alloc_pages and e1000
> > driver has to be fixed.
> 
> Why would they have to be fixed?

alloc_pages_node (used  by dma_alloc_pages) does not seem to do the check 
though.  I guess alloc_pages_node needs to be fixed then.

Thanks,
Kiran

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [discuss] Re: pcibus_to_node value when no pxm info is present for the pci bus
  2005-12-08 19:34   ` Ravikiran G Thirumalai
@ 2005-12-08 20:04     ` Andi Kleen
  2005-12-08 20:21       ` Ravikiran G Thirumalai
  0 siblings, 1 reply; 8+ messages in thread
From: Andi Kleen @ 2005-12-08 20:04 UTC (permalink / raw)
  To: Ravikiran G Thirumalai; +Cc: Christoph Lameter, linux-kernel, discuss

> > > The question is, what should be the default pcibus_to_node if there is no
> > > pxm info? Answer seems like -1 -- in which case dma_alloc_pages and e1000
> > > driver has to be fixed.
> > 
> > Why would they have to be fixed?
> 
> alloc_pages_node (used  by dma_alloc_pages) does not seem to do the check 
> though.  I guess alloc_pages_node needs to be fixed then.

Or just fix the caller. I will do that and change the default to
return -1 instead of 0.

Thanks,
-Andi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [discuss] Re: pcibus_to_node value when no pxm info is present for the pci bus
  2005-12-08 20:04     ` [discuss] " Andi Kleen
@ 2005-12-08 20:21       ` Ravikiran G Thirumalai
  2005-12-08 20:26         ` Andi Kleen
  2005-12-08 20:41         ` Christoph Lameter
  0 siblings, 2 replies; 8+ messages in thread
From: Ravikiran G Thirumalai @ 2005-12-08 20:21 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Christoph Lameter, linux-kernel, discuss

On Thu, Dec 08, 2005 at 09:04:40PM +0100, Andi Kleen wrote:
> > > > The question is, what should be the default pcibus_to_node if there is no
> > > > pxm info? Answer seems like -1 -- in which case dma_alloc_pages and e1000
> > > > driver has to be fixed.
> > > 
> > > Why would they have to be fixed?
> > 
> > alloc_pages_node (used  by dma_alloc_pages) does not seem to do the check 
> > though.  I guess alloc_pages_node needs to be fixed then.
> 
> Or just fix the caller. I will do that and change the default to

That was my thinking earlier too, but shouldn't we have uniformity in
behaviour between kmalloc_node and alloc_pages_node wrt nodeid handling?  
IMHO it would be less confusing that way. alloc_pages_node is not that much 
of a fastpath routine anyways...

Thanks,
Kiran

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [discuss] Re: pcibus_to_node value when no pxm info is present for the pci bus
  2005-12-08 20:21       ` Ravikiran G Thirumalai
@ 2005-12-08 20:26         ` Andi Kleen
  2005-12-08 20:41         ` Christoph Lameter
  1 sibling, 0 replies; 8+ messages in thread
From: Andi Kleen @ 2005-12-08 20:26 UTC (permalink / raw)
  To: Ravikiran G Thirumalai
  Cc: Andi Kleen, Christoph Lameter, linux-kernel, discuss

> That was my thinking earlier too, but shouldn't we have uniformity in
> behaviour between kmalloc_node and alloc_pages_node wrt nodeid handling?  
> IMHO it would be less confusing that way. alloc_pages_node is not that much 
> of a fastpath routine anyways...

No strong opinion either way.

-Andi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [discuss] Re: pcibus_to_node value when no pxm info is present for the pci bus
  2005-12-08 20:21       ` Ravikiran G Thirumalai
  2005-12-08 20:26         ` Andi Kleen
@ 2005-12-08 20:41         ` Christoph Lameter
  2005-12-08 20:47           ` Andi Kleen
  1 sibling, 1 reply; 8+ messages in thread
From: Christoph Lameter @ 2005-12-08 20:41 UTC (permalink / raw)
  To: Ravikiran G Thirumalai; +Cc: Andi Kleen, linux-kernel, discuss

On Thu, 8 Dec 2005, Ravikiran G Thirumalai wrote:

> That was my thinking earlier too, but shouldn't we have uniformity in
> behaviour between kmalloc_node and alloc_pages_node wrt nodeid handling?  
> IMHO it would be less confusing that way. alloc_pages_node is not that much 
> of a fastpath routine anyways...

I agree.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [discuss] Re: pcibus_to_node value when no pxm info is present for the pci bus
  2005-12-08 20:41         ` Christoph Lameter
@ 2005-12-08 20:47           ` Andi Kleen
  0 siblings, 0 replies; 8+ messages in thread
From: Andi Kleen @ 2005-12-08 20:47 UTC (permalink / raw)
  To: Christoph Lameter
  Cc: Ravikiran G Thirumalai, Andi Kleen, linux-kernel, discuss

On Thu, Dec 08, 2005 at 12:41:28PM -0800, Christoph Lameter wrote:
> On Thu, 8 Dec 2005, Ravikiran G Thirumalai wrote:
> 
> > That was my thinking earlier too, but shouldn't we have uniformity in
> > behaviour between kmalloc_node and alloc_pages_node wrt nodeid handling?  
> > IMHO it would be less confusing that way. alloc_pages_node is not that much 
> > of a fastpath routine anyways...
> 
> I agree.

Ok I will submit a patch.

-Andi


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-12-08 20:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-07 22:34 pcibus_to_node value when no pxm info is present for the pci bus Ravikiran G Thirumalai
2005-12-08 19:05 ` Christoph Lameter
2005-12-08 19:34   ` Ravikiran G Thirumalai
2005-12-08 20:04     ` [discuss] " Andi Kleen
2005-12-08 20:21       ` Ravikiran G Thirumalai
2005-12-08 20:26         ` Andi Kleen
2005-12-08 20:41         ` Christoph Lameter
2005-12-08 20:47           ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox