]> Git Repo - linux.git/commit
slab: add SLAB_ACCOUNT flag
authorVladimir Davydov <[email protected]>
Thu, 14 Jan 2016 23:18:15 +0000 (15:18 -0800)
committerLinus Torvalds <[email protected]>
Fri, 15 Jan 2016 00:00:49 +0000 (16:00 -0800)
commit230e9fc2860450fbb1f33bdcf9093d92d7d91f5b
treed0cb29d821cc5c3ca49066f0ca5d9149066b157f
parenta9bb7e620efdfd29b6d1c238041173e411670996
slab: add SLAB_ACCOUNT flag

Currently, if we want to account all objects of a particular kmem cache,
we have to pass __GFP_ACCOUNT to each kmem_cache_alloc call, which is
inconvenient.  This patch introduces SLAB_ACCOUNT flag which if passed
to kmem_cache_create will force accounting for every allocation from
this cache even if __GFP_ACCOUNT is not passed.

This patch does not make any of the existing caches use this flag - it
will be done later in the series.

Note, a cache with SLAB_ACCOUNT cannot be merged with a cache w/o
SLAB_ACCOUNT, because merged caches share the same kmem_cache struct and
hence cannot have different sets of SLAB_* flags.  Thus using this flag
will probably reduce the number of merged slabs even if kmem accounting
is not used (only compiled in).

Signed-off-by: Vladimir Davydov <[email protected]>
Suggested-by: Tejun Heo <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Greg Thelen <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Pekka Enberg <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/memcontrol.h
include/linux/slab.h
mm/memcontrol.c
mm/slab.h
mm/slab_common.c
mm/slub.c
This page took 0.056161 seconds and 4 git commands to generate.