aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/slab_common.c')
-rw-r--r--mm/slab_common.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 538bade6df7d..a3443278ce3a 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -19,6 +19,7 @@
19#include <asm/tlbflush.h> 19#include <asm/tlbflush.h>
20#include <asm/page.h> 20#include <asm/page.h>
21#include <linux/memcontrol.h> 21#include <linux/memcontrol.h>
22#include <trace/events/kmem.h>
22 23
23#include "slab.h" 24#include "slab.h"
24 25
@@ -373,7 +374,7 @@ struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags)
373{ 374{
374 int index; 375 int index;
375 376
376 if (size > KMALLOC_MAX_SIZE) { 377 if (unlikely(size > KMALLOC_MAX_SIZE)) {
377 WARN_ON_ONCE(!(flags & __GFP_NOWARN)); 378 WARN_ON_ONCE(!(flags & __GFP_NOWARN));
378 return NULL; 379 return NULL;
379 } 380 }
@@ -495,6 +496,15 @@ void __init create_kmalloc_caches(unsigned long flags)
495} 496}
496#endif /* !CONFIG_SLOB */ 497#endif /* !CONFIG_SLOB */
497 498
499#ifdef CONFIG_TRACING
500void *kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order)
501{
502 void *ret = kmalloc_order(size, flags, order);
503 trace_kmalloc(_RET_IP_, ret, size, PAGE_SIZE << order, flags);
504 return ret;
505}
506EXPORT_SYMBOL(kmalloc_order_trace);
507#endif
498 508
499#ifdef CONFIG_SLABINFO 509#ifdef CONFIG_SLABINFO
500 510