Index: linux-2.6.18-rc4/mm/mempolicy.c =================================================================== --- linux-2.6.18-rc4.orig/mm/mempolicy.c 2006-08-10 09:51:20.103450447 -0700 +++ linux-2.6.18-rc4/mm/mempolicy.c 2006-08-10 09:56:07.190192247 -0700 @@ -89,7 +89,7 @@ #include #include #include -#include +#include #include #include @@ -99,8 +99,8 @@ #define MPOL_MF_INVERT (MPOL_MF_INTERNAL << 1) /* Invert check for nodemask */ #define MPOL_MF_STATS (MPOL_MF_INTERNAL << 2) /* Gather statistics */ -static struct sslab policy_cache; -static struct kmem_cache *sn_cache; +static struct slab policy_cache; +static struct slab sn_cache; #define PDprintk(fmt...) @@ -1447,13 +1447,13 @@ static void sp_delete(struct shared_poli PDprintk("deleting %lx-l%x\n", n->start, n->end); rb_erase(&n->nd, &sp->root); mpol_free(n->policy); - kmem_cache_free(sn_cache, n); + slab_free(&sn_cache, n); } struct sp_node * sp_alloc(unsigned long start, unsigned long end, struct mempolicy *pol) { - struct sp_node *n = kmem_cache_alloc(sn_cache, GFP_KERNEL); + struct sp_node *n = slab_alloc(&sn_cache, GFP_KERNEL); if (!n) return NULL; @@ -1507,7 +1507,7 @@ restart: spin_unlock(&sp->lock); if (new2) { mpol_free(new2->policy); - kmem_cache_free(sn_cache, new2); + slab_free(&sn_cache, new2); } return 0; } @@ -1555,7 +1555,7 @@ int mpol_set_shared_policy(struct shared } err = shared_policy_replace(info, vma->vm_pgoff, vma->vm_pgoff+sz, new); if (err && new) - kmem_cache_free(sn_cache, new); + slab_free(&sn_cache, new); return err; } @@ -1574,7 +1574,7 @@ void mpol_free_shared_policy(struct shar next = rb_next(&n->nd); rb_erase(&n->nd, &p->root); mpol_free(n->policy); - kmem_cache_free(sn_cache, n); + slab_free(&sn_cache, n); } spin_unlock(&p->lock); } @@ -1582,13 +1582,17 @@ void mpol_free_shared_policy(struct shar /* assumes fs == KERNEL_DS */ void __init numa_policy_init(void) { - if (slab_create(&policy_cache, ALIGN(sizeof(struct mempolicy), L1_CACHE_BYTES), - 2, GFP_KERNEL)) - panic("Failed to initialize policy cache\n"); - - sn_cache = kmem_cache_create("shared_policy_node", - sizeof(struct sp_node), - 0, SLAB_PANIC, NULL, NULL); + if (slab_create(&policy_cache, + ALIGN(sizeof(struct mempolicy), + L1_CACHE_BYTES), + 2, &page_allocator)) + panic("Failed to initialize policy cache\n"); + + if (slab_create(&sn_cache, + ALIGN(sizeof(struct sp_node), + L1_CACHE_BYTES), + 2, &page_allocator)) + panic("Failed to initialize shared_policy cache\n"); /* Set interleaving policy for system init. This way not all the data structures allocated at system boot end up in node zero. */