From 35e785ee677750ec6ca985a121cf0d88a0828988 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Sat, 22 Mar 2014 12:49:47 +1100 Subject: [PATCH] slub: use raw_cpu_inc for incrementing statistics Statistics are not critical to the operation of the allocation but should also not cause too much overhead. When __this_cpu_inc is altered to check if preemption is disabled this triggers. Use raw_cpu_inc to avoid the checks. Using this_cpu_ops may cause interrupt disable/enable sequences on various arches which may significantly impact allocator performance. Signed-off-by: Christoph Lameter Cc: Fengguang Wu Cc: Pekka Enberg Signed-off-by: Andrew Morton --- mm/slub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/slub.c b/mm/slub.c index 5c6b2b26ec50e4..06852501a9c816 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -224,7 +224,7 @@ static inline void memcg_propagate_slab_attrs(struct kmem_cache *s) { } static inline void stat(const struct kmem_cache *s, enum stat_item si) { #ifdef CONFIG_SLUB_STATS - __this_cpu_inc(s->cpu_slab->stat[si]); + raw_cpu_inc(s->cpu_slab->stat[si]); #endif }