]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: get rid of __GFP_KMEMCG
authorVladimir Davydov <vdavydov@parallels.com>
Thu, 22 May 2014 00:42:37 +0000 (10:42 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:42:37 +0000 (10:42 +1000)
commit4be126be96750bb53688ec29cec2a948d08db54e
treead4e404a8f2676ae25eb5397b224d298e230b4e9
parent21cc336b1883987556a226a88c3cff1db890e3c8
mm: get rid of __GFP_KMEMCG

Currently to allocate a page that should be charged to kmemcg (e.g.
threadinfo), we pass __GFP_KMEMCG flag to the page allocator.  The page
allocated is then to be freed by free_memcg_kmem_pages.  Apart from
looking asymmetrical, this also requires intrusion to the general
allocation path.  So let's introduce separate functions that will
alloc/free pages charged to kmemcg.

The new functions are called alloc_kmem_pages and free_kmem_pages.  They
should be used when the caller actually would like to use kmalloc, but has
to fall back to the page allocator for the allocation is large.  They only
differ from alloc_pages and free_pages in that besides allocating or
freeing pages they also charge them to the kmem resource counter of the
current memory cgroup.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Greg Thelen <gthelen@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Glauber Costa <glommer@gmail.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/gfp.h
include/linux/memcontrol.h
include/linux/slab.h
include/linux/thread_info.h
include/trace/events/gfpflags.h
kernel/fork.c
mm/memcontrol.c
mm/page_alloc.c
mm/slab_common.c
mm/slub.c