summaryrefslogtreecommitdiff
path: root/mm/slub.c
diff options
context:
space:
mode:
authorVladimir Davydov <vdavydov@virtuozzo.com>2015-11-06 05:48:59 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-06 06:34:48 +0300
commitd05e83a6f861ad02c2fcba75d4c4cfe49e3bc90f (patch)
treed87199e3bfd92b28a3d890db5379e0d986b21557 /mm/slub.c
parentbde304bdf4ec4a5f58cc1e90fe2d9cd2d96304c4 (diff)
downloadlinux-d05e83a6f861ad02c2fcba75d4c4cfe49e3bc90f.tar.xz
memcg: simplify charging kmem pages
Charging kmem pages proceeds in two steps. First, we try to charge the allocation size to the memcg the current task belongs to, then we allocate a page and "commit" the charge storing the pointer to the memcg in the page struct. Such a design looks overcomplicated, because there is not much sense in trying charging the allocation before actually allocating a page: we won't be able to consume much memory over the limit even if we charge after doing the actual allocation, besides we already charge user pages post factum, so being pedantic with kmem pages just looks pointless. So this patch simplifies the design by merging the "charge" and the "commit" steps into the same function, which takes the allocated page. Also, rename the charge and uncharge methods to memcg_kmem_charge and memcg_kmem_uncharge and make the charge method return error code instead of bool to conform to mem_cgroup_try_charge. Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slub.c')
0 files changed, 0 insertions, 0 deletions