Thread (49 messages) 49 messages, 11 authors, 2006-08-18

Re: [PATCH 1/1] network memory allocator.

From: Christoph Hellwig <hch@infradead.org>
Date: 2006-08-16 09:38:47
Also in: lkml, netdev

On Wed, Aug 16, 2006 at 01:32:02PM +0400, Evgeniy Polyakov wrote:
On Wed, Aug 16, 2006 at 10:10:29AM +0100, Christoph Hellwig (hch@infradead.org) wrote:
quoted
On Wed, Aug 16, 2006 at 02:05:03AM -0700, David Miller wrote:
quoted
From: Evgeniy Polyakov <redacted>
Date: Wed, 16 Aug 2006 13:00:31 +0400
quoted
So I would like to know how to determine which node should be used for
allocation. Changes of __get_user_pages() to alloc_pages_node() are
trivial.
netdev_alloc_skb() knows the netdevice, and therefore you can
obtain the "struct device;" referenced inside of the netdev,
and therefore you can determine the node using the struct
device.
It's not that easy unfortunately.  I did what you describe above in my
first prototype but then found out the hard way that the struct device
in the netdevice can be a non-pci one, e.g. for pcmcia.  Im that case
the kernel will crash on you becuase you can only get the node infortmation
for pci devices.  My current patchkit adds an "int node" member to struct
net_device instead.  I can repost the patchkit ontop of -mm (which is
the required slab memory leak tracking changes) if anyone cares.
Can we check device->bus_type or device->driver->bus against
&pci_bus_type for that?
We could, but I'd rather waste 4 bytes in struct net_device than having
such ugly warts in common code.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help