diff options
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -2592,13 +2592,24 @@ void *__kmalloc(size_t size, gfp_t flags) | |||
2592 | } | 2592 | } |
2593 | EXPORT_SYMBOL(__kmalloc); | 2593 | EXPORT_SYMBOL(__kmalloc); |
2594 | 2594 | ||
2595 | static 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 |
2596 | void *__kmalloc_node(size_t size, gfp_t flags, int node) | 2607 | void *__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 | ||