Skip to content

Commit

Permalink
slub-use-raw_cpu_inc-for-incrementing-statistics-fix
Browse files Browse the repository at this point in the history
add comment

Cc: Christoph Lameter <cl@linux.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
akpm00 authored and sfrothwell committed Apr 2, 2014
1 parent 35e785e commit f781f1a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ 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
/*
* The rmw is racy on a preemptible kernel but this is acceptable, so
* avoid this_cpu_add()'s irq-disable overhead.
*/
raw_cpu_inc(s->cpu_slab->stat[si]);
#endif
}
Expand Down

0 comments on commit f781f1a

Please sign in to comment.