aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
authorChristoph Lameter <cl@linux.com>2012-05-09 11:09:55 -0400
committerPekka Enberg <penberg@kernel.org>2012-06-01 02:25:40 -0400
commit188fd063208942a4681d8e8a4484ad0d4ae0fda1 (patch)
treed00d4b5884aa9ecb381be41220fb2b42c0a4c27a /mm/slub.c
parentf469743673ceda5181970eb6b8090ba728c956fb (diff)
slub: new_slab_objects() can also get objects from partial list
Moving the attempt to get a slab page from the partial lists simplifies __slab_alloc which is rather complicated. Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 5aacd434e2cb..b29246bc7392 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2130,9 +2130,15 @@ static inline void *new_slab_objects(struct kmem_cache *s, gfp_t flags,
2130 int node, struct kmem_cache_cpu **pc) 2130 int node, struct kmem_cache_cpu **pc)
2131{ 2131{
2132 void *freelist; 2132 void *freelist;
2133 struct kmem_cache_cpu *c; 2133 struct kmem_cache_cpu *c = *pc;
2134 struct page *page = new_slab(s, flags, node); 2134 struct page *page;
2135
2136 freelist = get_partial(s, flags, node, c);
2135 2137
2138 if (freelist)
2139 return freelist;
2140
2141 page = new_slab(s, flags, node);
2136 if (page) { 2142 if (page) {
2137 c = __this_cpu_ptr(s->cpu_slab); 2143 c = __this_cpu_ptr(s->cpu_slab);
2138 if (c->page) 2144 if (c->page)
@@ -2269,11 +2275,7 @@ new_slab:
2269 goto redo; 2275 goto redo;
2270 } 2276 }
2271 2277
2272 /* Then do expensive stuff like retrieving pages from the partial lists */ 2278 freelist = new_slab_objects(s, gfpflags, node, &c);
2273 freelist = get_partial(s, gfpflags, node, c);
2274
2275 if (!freelist)
2276 freelist = new_slab_objects(s, gfpflags, node, &c);
2277 2279
2278 if (unlikely(!freelist)) { 2280 if (unlikely(!freelist)) {
2279 if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit()) 2281 if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit())