Index: linux-2.6.16-rc1-mm2/mm/slab.c =================================================================== --- linux-2.6.16-rc1-mm2.orig/mm/slab.c 2006-01-20 08:35:10.000000000 -0800 +++ linux-2.6.16-rc1-mm2/mm/slab.c 2006-01-23 11:39:01.000000000 -0800 @@ -2685,8 +2685,15 @@ static inline void *____cache_alloc(stru struct array_cache *ac; #ifdef CONFIG_NUMA - if (unlikely(current->mempolicy && !in_interrupt())) { - int nid = slab_node(current->mempolicy); + if (unlikely((cachep->flags & SLAB_OBEYS_POLICIES) + && !in_interrupt())) { + int nid; + + if (cpuset_rr(current)) + nid = cpuset_rr_node(current); + + if (current->mempolicy) + nid = slab_node(current->mempolicy); if (nid != numa_node_id()) return __cache_alloc_node(cachep, flags, nid); Index: linux-2.6.16-rc1-mm2/fs/inode.c =================================================================== --- linux-2.6.16-rc1-mm2.orig/fs/inode.c 2006-01-20 08:35:09.000000000 -0800 +++ linux-2.6.16-rc1-mm2/fs/inode.c 2006-01-23 11:34:15.000000000 -0800 @@ -1377,7 +1377,10 @@ void __init inode_init(unsigned long mem /* inode slab cache */ inode_cachep = kmem_cache_create("inode_cache", sizeof(struct inode), - 0, SLAB_RECLAIM_ACCOUNT|SLAB_PANIC, init_once, NULL); + 0, + SLAB_RECLAIM_ACCOUNT|SLAB_PANIC| + SLAB_OBEYS_POLICIES, + init_once, NULL); shrinker = set_shrinker(DEFAULT_SEEKS, shrink_icache_memory); kmem_set_shrinker(inode_cachep, shrinker); Index: linux-2.6.16-rc1-mm2/include/linux/slab.h =================================================================== --- linux-2.6.16-rc1-mm2.orig/include/linux/slab.h 2006-01-20 08:35:10.000000000 -0800 +++ linux-2.6.16-rc1-mm2/include/linux/slab.h 2006-01-23 11:28:31.000000000 -0800 @@ -47,7 +47,7 @@ typedef struct kmem_cache kmem_cache_t; what is reclaimable later*/ #define SLAB_PANIC 0x00040000UL /* panic if kmem_cache_create() fails */ #define SLAB_DESTROY_BY_RCU 0x00080000UL /* defer freeing pages to RCU */ - +#define SLAB_OBEYS_POLICIES 0x00100000UL /* Allocation obeys memory/cpuset policy */ /* flags passed to a constructor func */ #define SLAB_CTOR_CONSTRUCTOR 0x001UL /* if not set, then deconstructor */ #define SLAB_CTOR_ATOMIC 0x002UL /* tell constructor it can't sleep */ Index: linux-2.6.16-rc1-mm2/fs/dcache.c =================================================================== --- linux-2.6.16-rc1-mm2.orig/fs/dcache.c 2006-01-20 08:35:09.000000000 -0800 +++ linux-2.6.16-rc1-mm2/fs/dcache.c 2006-01-23 11:32:35.000000000 -0800 @@ -1845,7 +1845,8 @@ static void __init dcache_init(unsigned dentry_cache = kmem_cache_create("dentry_cache", sizeof(struct dentry), 0, - SLAB_RECLAIM_ACCOUNT|SLAB_PANIC, + SLAB_RECLAIM_ACCOUNT|SLAB_PANIC| + SLAB_OBEYS_POLICIES, NULL, NULL); shrinker = set_shrinker(DEFAULT_SEEKS, shrink_dcache_memory);