From: Ingo Molnar Date: Fri, 20 Feb 2009 11:15:30 +0000 (+0100) Subject: Merge branch 'for-ingo' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg... X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=057685cf57066bc8aaed68de1b1970e12f0075d2;p=linux-2.6-omap-h63xx.git Merge branch 'for-ingo' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6 into tracing/kmemtrace Conflicts: mm/slub.c --- 057685cf57066bc8aaed68de1b1970e12f0075d2 diff --cc include/linux/slub_def.h index 6b657f7dcb2,986e09dcfd8..9e3a575b2c3 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h @@@ -228,10 -224,8 +241,10 @@@ static __always_inline void *kmalloc_la static __always_inline void *kmalloc(size_t size, gfp_t flags) { + void *ret; + if (__builtin_constant_p(size)) { - if (size > PAGE_SIZE) + if (size > SLUB_MAX_SIZE) return kmalloc_large(size, flags); if (!(flags & SLUB_DMA)) { @@@ -256,26 -244,10 +269,26 @@@ void *__kmalloc_node(size_t size, gfp_t flags, int node); void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); +#ifdef CONFIG_KMEMTRACE +extern void *kmem_cache_alloc_node_notrace(struct kmem_cache *s, + gfp_t gfpflags, + int node); +#else +static __always_inline void * +kmem_cache_alloc_node_notrace(struct kmem_cache *s, + gfp_t gfpflags, + int node) +{ + return kmem_cache_alloc_node(s, gfpflags, node); +} +#endif + static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) { + void *ret; + if (__builtin_constant_p(size) && - size <= PAGE_SIZE && !(flags & SLUB_DMA)) { + size <= SLUB_MAX_SIZE && !(flags & SLUB_DMA)) { struct kmem_cache *s = kmalloc_slab(size); if (!s) diff --cc mm/slub.c index 3525e7b21d1,5a5e7f5bf79..6de5e07c885 --- a/mm/slub.c +++ b/mm/slub.c @@@ -2688,9 -2657,8 +2688,9 @@@ static struct kmem_cache *get_slab(size void *__kmalloc(size_t size, gfp_t flags) { struct kmem_cache *s; + void *ret; - if (unlikely(size > PAGE_SIZE)) + if (unlikely(size > SLUB_MAX_SIZE)) return kmalloc_large(size, flags); s = get_slab(size, flags); @@@ -2722,18 -2685,9 +2722,18 @@@ static void *kmalloc_large_node(size_t void *__kmalloc_node(size_t size, gfp_t flags, int node) { struct kmem_cache *s; + void *ret; - if (unlikely(size > PAGE_SIZE)) { - if (unlikely(size > SLUB_MAX_SIZE)) - return kmalloc_large_node(size, flags, node); ++ if (unlikely(size > SLUB_MAX_SIZE)) { + ret = kmalloc_large_node(size, flags, node); + + kmemtrace_mark_alloc_node(KMEMTRACE_TYPE_KMALLOC, + _RET_IP_, ret, + size, PAGE_SIZE << get_order(size), + flags, node); + + return ret; + } s = get_slab(size, flags); @@@ -3275,9 -3221,8 +3275,9 @@@ static struct notifier_block __cpuinitd void *__kmalloc_track_caller(size_t size, gfp_t gfpflags, unsigned long caller) { struct kmem_cache *s; + void *ret; - if (unlikely(size > PAGE_SIZE)) + if (unlikely(size > SLUB_MAX_SIZE)) return kmalloc_large(size, gfpflags); s = get_slab(size, gfpflags); @@@ -3298,9 -3237,8 +3298,9 @@@ void *__kmalloc_node_track_caller(size_ int node, unsigned long caller) { struct kmem_cache *s; + void *ret; - if (unlikely(size > PAGE_SIZE)) + if (unlikely(size > SLUB_MAX_SIZE)) return kmalloc_large_node(size, gfpflags, node); s = get_slab(size, gfpflags);