linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -mm v2 0/2] cleanup kmemcg charging (was: "kmemcg: get rid of __GFP_KMEMCG")
@ 2014-04-01  7:38 Vladimir Davydov
  2014-04-01  7:38 ` [PATCH -mm v2 1/2] sl[au]b: charge slabs to kmemcg explicitly Vladimir Davydov
  2014-04-01  7:38 ` [PATCH -mm v2 2/2] mm: get rid of __GFP_KMEMCG Vladimir Davydov
  0 siblings, 2 replies; 16+ messages in thread
From: Vladimir Davydov @ 2014-04-01  7:38 UTC (permalink / raw)
  To: akpm; +Cc: hannes, mhocko, glommer, gthelen, linux-kernel, linux-mm, devel

Hi,

Currently we charge kmem to memcg in alloc_pages if __GFP_KMEMCG is
passed. However, since there are only a few places where we actually
want to charge kmem, we could call kmemcg charge function explicitly
instead. That would remove all kmemcg-related stuff from the general
allocation path and make all kmem charges easier to follow.

So let's charge kmem explicitly where we want it to be charged (slab,
threadinfo) and remove __GFP_KMEMCG.

Changes in v2:
 - use static key optimization in memcg_(un)charge_slab to avoid any
   overhead if kmemcg is not used;
 - introduce helper functions, alloc/free_kmem_pages, which charge newly
   allocated pages to kmemcg, to avoid code duplication;
 - do not remove accounting of kmalloc_large allocations (as discussed in the
   comments to v1).

v1 can be found at lkml.org/lkml/2014/3/26/228

Thanks,

Vladimir Davydov (2):
  sl[au]b: charge slabs to kmemcg explicitly
  mm: get rid of __GFP_KMEMCG

 include/linux/gfp.h             |   10 ++++---
 include/linux/memcontrol.h      |   17 ++++--------
 include/linux/slab.h            |   11 --------
 include/linux/thread_info.h     |    2 --
 include/trace/events/gfpflags.h |    1 -
 kernel/fork.c                   |    6 ++---
 mm/memcontrol.c                 |    4 +--
 mm/page_alloc.c                 |   56 ++++++++++++++++++++++++---------------
 mm/slab.c                       |    7 ++++-
 mm/slab.h                       |   29 ++++++++++++++++++++
 mm/slab_common.c                |   18 +++++++++----
 mm/slub.c                       |   30 ++++++++++++++-------
 12 files changed, 119 insertions(+), 72 deletions(-)

-- 
1.7.10.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-04-11 17:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-01  7:38 [PATCH -mm v2 0/2] cleanup kmemcg charging (was: "kmemcg: get rid of __GFP_KMEMCG") Vladimir Davydov
2014-04-01  7:38 ` [PATCH -mm v2 1/2] sl[au]b: charge slabs to kmemcg explicitly Vladimir Davydov
2014-04-02  0:49   ` Greg Thelen
2014-04-01  7:38 ` [PATCH -mm v2 2/2] mm: get rid of __GFP_KMEMCG Vladimir Davydov
2014-04-02  0:48   ` Greg Thelen
2014-04-02  6:11     ` Vladimir Davydov
2014-04-02  6:16   ` [PATCH -mm v2.1] " Vladimir Davydov
2014-04-02 21:25     ` Greg Thelen
2014-04-03 15:04       ` Vladimir Davydov
2014-04-03 15:05     ` [PATCH -mm v2.2] " Vladimir Davydov
2014-04-10 23:38       ` Andrew Morton
2014-04-11 12:52         ` [PATCH -mm] slab: document kmalloc_order Vladimir Davydov
2014-04-11 15:57           ` Christoph Lameter
2014-04-11 17:24             ` Vladimir Davydov
2014-04-11 16:07       ` [PATCH -mm v2.2] mm: get rid of __GFP_KMEMCG Christoph Lameter
2014-04-11 17:33         ` Vladimir Davydov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).