2008-02-19 11:15:51

by Yinghai Lu

[permalink] [raw]
Subject: [PATCH 6/8] net: use numa_node in net_devcice->dev instead of parent


Signed-off-by: Yinghai Lu <[email protected]>

Index: linux-2.6/net/core/skbuff.c
===================================================================
--- linux-2.6.orig/net/core/skbuff.c
+++ linux-2.6/net/core/skbuff.c
@@ -252,7 +252,7 @@ nodata:
struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
unsigned int length, gfp_t gfp_mask)
{
- int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1;
+ int node = dev_to_node(&dev->dev);
struct sk_buff *skb;

skb = __alloc_skb(length + NET_SKB_PAD, gfp_mask | __GFP_NOTRACK,


2008-02-19 11:22:19

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 6/8] net: use numa_node in net_devcice->dev instead of parent


* Yinghai Lu <[email protected]> wrote:

> struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
> unsigned int length, gfp_t gfp_mask)
> {
> - int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1;
> + int node = dev_to_node(&dev->dev);

i think this is a fix for the networking folks. (Dave Cc:-ed)

Ingo

2008-02-19 11:40:55

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 6/8] net: use numa_node in net_devcice->dev instead of parent

From: Ingo Molnar <[email protected]>
Date: Tue, 19 Feb 2008 12:21:46 +0100

>
> * Yinghai Lu <[email protected]> wrote:
>
> > struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
> > unsigned int length, gfp_t gfp_mask)
> > {
> > - int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1;
> > + int node = dev_to_node(&dev->dev);
>
> i think this is a fix for the networking folks. (Dave Cc:-ed)

It keeps getting NAK's because it's wrong.

The author of the patch hasn't convinced folks why this is really
necessary, and using the net_device embedded device struct is
definitely wrong here. It doesn't contain the NUMA node information,
the physical device does, and that is what the parent it.

2008-02-19 19:21:59

by Yinghai Lu

[permalink] [raw]
Subject: Re: [PATCH 6/8] net: use numa_node in net_devcice->dev instead of parent

On Tuesday 19 February 2008 03:41:10 am David Miller wrote:
> From: Ingo Molnar <[email protected]>
> Date: Tue, 19 Feb 2008 12:21:46 +0100
>
> >
> > * Yinghai Lu <[email protected]> wrote:
> >
> > > struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
> > > unsigned int length, gfp_t gfp_mask)
> > > {
> > > - int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1;
> > > + int node = dev_to_node(&dev->dev);
> >
> > i think this is a fix for the networking folks. (Dave Cc:-ed)
>
> It keeps getting NAK's because it's wrong.
>
> The author of the patch hasn't convinced folks why this is really
> necessary, and using the net_device embedded device struct is
> definitely wrong here. It doesn't contain the NUMA node information,
> the physical device does, and that is what the parent it.

can you check the 5/8?
that will make sure every struct device get numa_node get assigned.

YH

2008-02-19 19:48:33

by Yinghai Lu

[permalink] [raw]
Subject: Re: [PATCH 6/8] net: use numa_node in net_devcice->dev instead of parent

On Feb 19, 2008 11:42 AM, Yinghai Lu <[email protected]> wrote:
> On Tuesday 19 February 2008 03:41:10 am David Miller wrote:
> > From: Ingo Molnar <[email protected]>
> > Date: Tue, 19 Feb 2008 12:21:46 +0100
> >
> > >
> > > * Yinghai Lu <[email protected]> wrote:
> > >
> > > > struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
> > > > unsigned int length, gfp_t gfp_mask)
> > > > {
> > > > - int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1;
> > > > + int node = dev_to_node(&dev->dev);
> > >
> > > i think this is a fix for the networking folks. (Dave Cc:-ed)
> >
> > It keeps getting NAK's because it's wrong.
> >
> > The author of the patch hasn't convinced folks why this is really
> > necessary, and using the net_device embedded device struct is
> > definitely wrong here. It doesn't contain the NUMA node information,
> > the physical device does, and that is what the parent it.
>
> can you check the 5/8?
> that will make sure every struct device get numa_node get assigned.
>
> YH
>
or need to combine 5 and 6 together?

YH

2008-02-19 22:54:44

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 6/8] net: use numa_node in net_devcice->dev instead of parent

From: Yinghai Lu <[email protected]>
Date: Tue, 19 Feb 2008 11:42:48 -0800

> On Tuesday 19 February 2008 03:41:10 am David Miller wrote:
> > From: Ingo Molnar <[email protected]>
> > Date: Tue, 19 Feb 2008 12:21:46 +0100
> >
> > >
> > > * Yinghai Lu <[email protected]> wrote:
> > >
> > > > struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
> > > > unsigned int length, gfp_t gfp_mask)
> > > > {
> > > > - int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1;
> > > > + int node = dev_to_node(&dev->dev);
> > >
> > > i think this is a fix for the networking folks. (Dave Cc:-ed)
> >
> > It keeps getting NAK's because it's wrong.
> >
> > The author of the patch hasn't convinced folks why this is really
> > necessary, and using the net_device embedded device struct is
> > definitely wrong here. It doesn't contain the NUMA node information,
> > the physical device does, and that is what the parent it.
>
> can you check the 5/8?
> that will make sure every struct device get numa_node get assigned.

Why do we need to bother with that if the parent will have the
necessary information for us here?

2008-02-19 23:10:27

by Yinghai Lu

[permalink] [raw]
Subject: Re: [PATCH 6/8] net: use numa_node in net_devcice->dev instead of parent

On Feb 19, 2008 2:55 PM, David Miller <[email protected]> wrote:
> From: Yinghai Lu <[email protected]>
> Date: Tue, 19 Feb 2008 11:42:48 -0800
>
> > On Tuesday 19 February 2008 03:41:10 am David Miller wrote:
> > > From: Ingo Molnar <[email protected]>
> > > Date: Tue, 19 Feb 2008 12:21:46 +0100
> > >
> > > >
> > > > * Yinghai Lu <[email protected]> wrote:
> > > >
> > > > > struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
> > > > > unsigned int length, gfp_t gfp_mask)
> > > > > {
> > > > > - int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1;
> > > > > + int node = dev_to_node(&dev->dev);
> > > >
> > > > i think this is a fix for the networking folks. (Dave Cc:-ed)
> > >
> > > It keeps getting NAK's because it's wrong.
> > >
> > > The author of the patch hasn't convinced folks why this is really
> > > necessary, and using the net_device embedded device struct is
> > > definitely wrong here. It doesn't contain the NUMA node information,
> > > the physical device does, and that is what the parent it.
> >
> > can you check the 5/8?
> > that will make sure every struct device get numa_node get assigned.
>
> Why do we need to bother with that if the parent will have the
> necessary information for us here?

less code?

or some kind of usb or other bus interface. may have several level...

YH

2008-02-20 06:27:36

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 6/8] net: use numa_node in net_devcice->dev instead of parent


* Yinghai Lu <[email protected]> wrote:

> > > can you check the 5/8? that will make sure every struct device get
> > > numa_node get assigned.
> >
> > Why do we need to bother with that if the parent will have the
> > necessary information for us here?
>
> less code?
>
> or some kind of usb or other bus interface. may have several level...

you mean it's a small optimization: otherwise every struct device (net
dev, usb...) need to go back to find another pci device (parent or host
controller) to use their numa_node.

Ingo

2008-02-20 08:34:16

by Yinghai Lu

[permalink] [raw]
Subject: Re: [PATCH 6/8] net: use numa_node in net_devcice->dev instead of parent

On Feb 19, 2008 10:27 PM, Ingo Molnar <[email protected]> wrote:
>
> * Yinghai Lu <[email protected]> wrote:
>
> > > > can you check the 5/8? that will make sure every struct device get
> > > > numa_node get assigned.
> > >
> > > Why do we need to bother with that if the parent will have the
> > > necessary information for us here?
> >
> > less code?
> >
> > or some kind of usb or other bus interface. may have several level...
>
> you mean it's a small optimization: otherwise every struct device (net
> dev, usb...) need to go back to find another pci device (parent or host
> controller) to use their numa_node.
>
Yes.

YH