[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1403180942030.17965@nuc>
Date: Tue, 18 Mar 2014 09:43:27 -0500 (CDT)
From: Christoph Lameter <cl@...ux.com>
To: Fengguang Wu <fengguang.wu@...el.com>
cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Pekka Enberg <penberg@...nel.org>
Subject: Re: [percpu] BUG: using __this_cpu_add() in preemptible [00000000]
code: init/1
Anyways the statistics in slub should be low impact and able to
be placed anywhere. So I think we need this patch to avoid
the preemption checks begin triggered.
Subject: 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.
__this_cpu_inc now checks if preemption is disabled and 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 <cl@...ux.com>
Index: linux/mm/slub.c
===================================================================
--- linux.orig/mm/slub.c 2014-03-07 14:10:30.142777022 -0600
+++ linux/mm/slub.c 2014-03-18 09:39:15.675035324 -0500
@@ -224,7 +224,7 @@
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
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists