aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2008-03-01 16:56:40 -0500
committerChristoph Lameter <clameter@sgi.com>2008-03-03 15:22:32 -0500
commitf619cfe1bda809a97c407f4c723eb3235ecd64e5 (patch)
treed073f8fe0221c2c196aaa888e7bc861c275f7fbd /mm
parent7693143481730686362cc6360e3d47c012d9b2c8 (diff)
slub: Add kmalloc_large_node() to support kmalloc_node fallback
Slub is missing some NUMA support for large kmallocs. Provide that. Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Christoph Lameter <clameter@sgi.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/slub.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/mm/slub.c b/mm/slub.c
index db8026ba049..ecacacdce9d 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2592,13 +2592,24 @@ void *__kmalloc(size_t size, gfp_t flags)
2592} 2592}
2593EXPORT_SYMBOL(__kmalloc); 2593EXPORT_SYMBOL(__kmalloc);
2594 2594
2595static void *kmalloc_large_node(size_t size, gfp_t flags, int node)
2596{
2597 struct page *page = alloc_pages_node(node, flags | __GFP_COMP,
2598 get_order(size));
2599
2600 if (page)
2601 return page_address(page);
2602 else
2603 return NULL;
2604}
2605
2595#ifdef CONFIG_NUMA 2606#ifdef CONFIG_NUMA
2596void *__kmalloc_node(size_t size, gfp_t flags, int node) 2607void *__kmalloc_node(size_t size, gfp_t flags, int node)
2597{ 2608{
2598 struct kmem_cache *s; 2609 struct kmem_cache *s;
2599 2610
2600 if (unlikely(size > PAGE_SIZE)) 2611 if (unlikely(size > PAGE_SIZE))
2601 return kmalloc_large(size, flags); 2612 return kmalloc_large_node(size, flags, node);
2602 2613
2603 s = get_slab(size, flags); 2614 s = get_slab(size, flags);
2604 2615
@@ -3146,7 +3157,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
3146 struct kmem_cache *s; 3157 struct kmem_cache *s;
3147 3158
3148 if (unlikely(size > PAGE_SIZE)) 3159 if (unlikely(size > PAGE_SIZE))
3149 return kmalloc_large(size, gfpflags); 3160 return kmalloc_large_node(size, gfpflags, node);
3150 3161
3151 s = get_slab(size, gfpflags); 3162 s = get_slab(size, gfpflags);
3152 3163