Badari Pulavarty wrote: >Am I missing something fundamental here ? > > > No, you are right. The current implementation is just wrong(tm). Attached is a patch - partially tested. Description: kmem_cache_alloc_node allocates memory from a particular node. The patch fixes two problems with the current implementation: - for !CONFIG_NUMA, kmem_cache_alloc_node is identical to kmalloc. The patch implements kmem_cache_alloc_node as an alias to kmalloc for !CONFIG_NUMA. Right now, the special node aware code runs even on non-NUMA systems. - checks the slab lists instead of allocating a new slab for every allocation. This reduces the internal fragmentation. Badri - could you test the patch? Andrew, please do not merge the patch yet: it contains a severe bug: if a node doesn't contain any memory, then it livelocks because the loop never finds a suitable slab. I must think about that case. -- Manfred