提交 5b74ada7 编写于 作者: R Ravikiran G Thirumalai 提交者: Linus Torvalds

[PATCH] slab: allocate node local memory for off-slab slabmanagement

Allocate off-slab slab descriptors from node local memory.
Signed-off-by: NAlok N Kataria <alokk@calsoftinc.com>
Signed-off-by: NRavikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: NShai Fultheim <shai@scalex86.org>
Acked-by: NChristoph Lameter <clameter@sgi.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 a283a525
...@@ -2318,13 +2318,15 @@ EXPORT_SYMBOL(kmem_cache_destroy); ...@@ -2318,13 +2318,15 @@ EXPORT_SYMBOL(kmem_cache_destroy);
/* Get the memory for a slab management obj. */ /* Get the memory for a slab management obj. */
static struct slab *alloc_slabmgmt(struct kmem_cache *cachep, void *objp, static struct slab *alloc_slabmgmt(struct kmem_cache *cachep, void *objp,
int colour_off, gfp_t local_flags) int colour_off, gfp_t local_flags,
int nodeid)
{ {
struct slab *slabp; struct slab *slabp;
if (OFF_SLAB(cachep)) { if (OFF_SLAB(cachep)) {
/* Slab management obj is off-slab. */ /* Slab management obj is off-slab. */
slabp = kmem_cache_alloc(cachep->slabp_cache, local_flags); slabp = kmem_cache_alloc_node(cachep->slabp_cache,
local_flags, nodeid);
if (!slabp) if (!slabp)
return NULL; return NULL;
} else { } else {
...@@ -2334,6 +2336,7 @@ static struct slab *alloc_slabmgmt(struct kmem_cache *cachep, void *objp, ...@@ -2334,6 +2336,7 @@ static struct slab *alloc_slabmgmt(struct kmem_cache *cachep, void *objp,
slabp->inuse = 0; slabp->inuse = 0;
slabp->colouroff = colour_off; slabp->colouroff = colour_off;
slabp->s_mem = objp + colour_off; slabp->s_mem = objp + colour_off;
slabp->nodeid = nodeid;
return slabp; return slabp;
} }
...@@ -2519,7 +2522,7 @@ static int cache_grow(struct kmem_cache *cachep, gfp_t flags, int nodeid) ...@@ -2519,7 +2522,7 @@ static int cache_grow(struct kmem_cache *cachep, gfp_t flags, int nodeid)
goto failed; goto failed;
/* Get slab management. */ /* Get slab management. */
slabp = alloc_slabmgmt(cachep, objp, offset, local_flags); slabp = alloc_slabmgmt(cachep, objp, offset, local_flags, nodeid);
if (!slabp) if (!slabp)
goto opps1; goto opps1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册