aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/slab.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mm/slab.c b/mm/slab.c
index f055c1420216..afabad54c4c6 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2318,13 +2318,15 @@ EXPORT_SYMBOL(kmem_cache_destroy);
2318 2318
2319/* Get the memory for a slab management obj. */ 2319/* Get the memory for a slab management obj. */
2320static struct slab *alloc_slabmgmt(struct kmem_cache *cachep, void *objp, 2320static struct slab *alloc_slabmgmt(struct kmem_cache *cachep, void *objp,
2321 int colour_off, gfp_t local_flags) 2321 int colour_off, gfp_t local_flags,
2322 int nodeid)
2322{ 2323{
2323 struct slab *slabp; 2324 struct slab *slabp;
2324 2325
2325 if (OFF_SLAB(cachep)) { 2326 if (OFF_SLAB(cachep)) {
2326 /* Slab management obj is off-slab. */ 2327 /* Slab management obj is off-slab. */
2327 slabp = kmem_cache_alloc(cachep->slabp_cache, local_flags); 2328 slabp = kmem_cache_alloc_node(cachep->slabp_cache,
2329 local_flags, nodeid);
2328 if (!slabp) 2330 if (!slabp)
2329 return NULL; 2331 return NULL;
2330 } else { 2332 } else {
@@ -2334,6 +2336,7 @@ static struct slab *alloc_slabmgmt(struct kmem_cache *cachep, void *objp,
2334 slabp->inuse = 0; 2336 slabp->inuse = 0;
2335 slabp->colouroff = colour_off; 2337 slabp->colouroff = colour_off;
2336 slabp->s_mem = objp + colour_off; 2338 slabp->s_mem = objp + colour_off;
2339 slabp->nodeid = nodeid;
2337 return slabp; 2340 return slabp;
2338} 2341}
2339 2342
@@ -2519,7 +2522,7 @@ static int cache_grow(struct kmem_cache *cachep, gfp_t flags, int nodeid)
2519 goto failed; 2522 goto failed;
2520 2523
2521 /* Get slab management. */ 2524 /* Get slab management. */
2522 slabp = alloc_slabmgmt(cachep, objp, offset, local_flags); 2525 slabp = alloc_slabmgmt(cachep, objp, offset, local_flags, nodeid);
2523 if (!slabp) 2526 if (!slabp)
2524 goto opps1; 2527 goto opps1;
2525 2528