linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC] [PATCH 0/4] memcg: Kernel memory accounting.
@ 2011-10-15  0:38 Suleiman Souhlal
  2011-10-15  0:38 ` [RFC] [PATCH 1/4] memcg: Kernel memory accounting infrastructure Suleiman Souhlal
  2011-10-17  0:32 ` [RFC] [PATCH 0/4] memcg: Kernel " KAMEZAWA Hiroyuki
  0 siblings, 2 replies; 8+ messages in thread
From: Suleiman Souhlal @ 2011-10-15  0:38 UTC (permalink / raw)
  To: glommer
  Cc: gthelen, yinghan, kamezawa.hiroyu, jbottomley, suleiman, linux-mm,
	Suleiman Souhlal

This patch series introduces kernel memory accounting to memcg.
It currently only accounts for slab.

With this, kernel memory gets counted in a memcg's usage_in_bytes.

Slab gets accounted per-page, by using per-cgroup kmem_caches that
get created the first time an allocation of that type is done by
that cgroup.
This means that we only have to do charges/uncharges in the slow
path of the slab allocator, which should have low performance
impacts.

A per-cgroup kmem_cache will appear in slabinfo named like its
original cache, with the cgroup's name in parenthesis.
On cgroup deletion, the accounting gets moved to the root cgroup
and any existing cgroup kmem_cache gets "dead" appended to its
name, to indicate that its accounting was migrated.

TODO:
	- Per-memcg slab shrinking (we have patches for that already).
	- Make it support the other slab allocators.
	- Come up with a scheme that does not require holding
	  rcu_read_lock in the whole slab allocation path.
	- Account for other types of kernel memory than slab.
	- Migrate to the parent cgroup instead of root on cgroup
	  deletion.

---
 Documentation/cgroups/memory.txt |   33 +++
 include/linux/gfp.h              |    2 
 include/linux/memcontrol.h       |   35 +++
 include/linux/slab.h             |    1 
 include/linux/slab_def.h         |   47 ++++
 init/Kconfig                     |   10 -
 mm/memcontrol.c                  |  373 ++++++++++++++++++++++++++++++++++++++-
 mm/slab.c                        |  284 +++++++++++++++++++++++++++--
 8 files changed, 755 insertions(+), 30 deletions(-)

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2011-10-17 17:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-15  0:38 [RFC] [PATCH 0/4] memcg: Kernel memory accounting Suleiman Souhlal
2011-10-15  0:38 ` [RFC] [PATCH 1/4] memcg: Kernel memory accounting infrastructure Suleiman Souhlal
2011-10-15  0:38   ` [RFC] [PATCH 2/4] memcg: Introduce __GFP_NOACCOUNT Suleiman Souhlal
2011-10-15  0:38     ` [RFC] [PATCH 3/4] memcg: Slab accounting Suleiman Souhlal
2011-10-15  0:38       ` [RFC] [PATCH 4/4] memcg: Document kernel memory accounting Suleiman Souhlal
2011-10-17  8:56         ` Glauber Costa
2011-10-17 17:19           ` Suleiman Souhlal
2011-10-17  0:32 ` [RFC] [PATCH 0/4] memcg: Kernel " KAMEZAWA Hiroyuki

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).