On Wed, 2005-09-21 at 06:33, Christoph Lameter wrote: Hi Christoph, I have some doubts over this... >/On Tue, 20 Sep 2005, Petr Vandrovec wrote: > >> slab belonging to node#1, while having acquired lock for cachep belonging >> to node #0. Due to this check_spinlock_acquired_node(cachep, nodeid) fails >> (check_spinlock_acquired_node(cachep, 0) would succeed). > >Hmmm. If a node runs out of memory then pages from another node may end up >on the slab list of a node. But it seems that free_block cannot handle >that properly. > >How are you producing the problem? > >Could you try the following patch: > >--- > >The numa slab allocator may allocate pages from foreign nodes onto the lists >for a particular node if a node runs out of memory. Inspecting the slab->nodeid >field will not reflect that the page is now in use for the slabs of another node. >/ > / / IMO the slab->nodeid field just lets us know to which nodes list3 is this slab attached, irrespective of the node from which node the memory was got. >/This patch fixes that issue by adding a node field to free_block so that the caller >can indicate which node currently uses a slab. > >/ > But the nodeid is already accessible through the slab-descriptor of this object, and this nodeid is set in the cache_grow function. >/Also removes the check for the current node from kmalloc_cache_node since the >process may shift later to another node which may lead to an allocation on another >node than intended. >/ > Yeah that is possible, but won't putting a check in __cache_alloc_node after disabling the interrupt be better, because kmalloc_node/kmem_cache_alloc_node can be called at runtime as well, and getting the object directly from the slabs, instead of the arraycaches may slow up things. Thus tweaking the patch a little. Thanks & Regards, Alok