aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@engr.sgi.com>2006-02-01 06:05:43 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-01 11:53:17 -0500
commit18f820f655ce93b1e4d9b48fc6fcafc64157c6bc (patch)
tree62c759bb1d7d3675a3dee5dbb345cb63dfa7522b /mm/slab.c
parent3dafccf22751429e69b6266636cf3acf45b48075 (diff)
[PATCH] slab: minor cleanup to kmem_cache_alloc_node
Clean up kmem_cache_alloc_node a bit. Signed-off-by: Christoph Lameter <clameter@sgi.com> Acked-by: Manfred Spraul <manfred@colorfullife.com> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/slab.c')
-rw-r--r--mm/slab.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 1a014aaf4491..bb7a9837b949 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2928,27 +2928,18 @@ void *kmem_cache_alloc_node(kmem_cache_t *cachep, gfp_t flags, int nodeid)
2928 unsigned long save_flags; 2928 unsigned long save_flags;
2929 void *ptr; 2929 void *ptr;
2930 2930
2931 if (nodeid == -1)
2932 return __cache_alloc(cachep, flags);
2933
2934 if (unlikely(!cachep->nodelists[nodeid])) {
2935 /* Fall back to __cache_alloc if we run into trouble */
2936 printk(KERN_WARNING
2937 "slab: not allocating in inactive node %d for cache %s\n",
2938 nodeid, cachep->name);
2939 return __cache_alloc(cachep, flags);
2940 }
2941
2942 cache_alloc_debugcheck_before(cachep, flags); 2931 cache_alloc_debugcheck_before(cachep, flags);
2943 local_irq_save(save_flags); 2932 local_irq_save(save_flags);
2944 if (nodeid == numa_node_id()) 2933
2934 if (nodeid == -1 || nodeid == numa_node_id() ||
2935 !cachep->nodelists[nodeid])
2945 ptr = ____cache_alloc(cachep, flags); 2936 ptr = ____cache_alloc(cachep, flags);
2946 else 2937 else
2947 ptr = __cache_alloc_node(cachep, flags, nodeid); 2938 ptr = __cache_alloc_node(cachep, flags, nodeid);
2948 local_irq_restore(save_flags); 2939 local_irq_restore(save_flags);
2949 ptr = 2940
2950 cache_alloc_debugcheck_after(cachep, flags, ptr, 2941 ptr = cache_alloc_debugcheck_after(cachep, flags, ptr,
2951 __builtin_return_address(0)); 2942 __builtin_return_address(0));
2952 2943
2953 return ptr; 2944 return ptr;
2954} 2945}