diff options
author | Glauber Costa <glommer@parallels.com> | 2012-12-18 17:22:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-18 18:02:14 -0500 |
commit | 7cf2798240a2a2230cb16a391beef98d8a7ad362 (patch) | |
tree | 989f28b74d08bf91938cc5a7fe632faa32e7542f /include/linux/memcontrol.h | |
parent | 1f458cbf122288b23620ee822e19bcbb76c8d6ec (diff) |
memcg/sl[au]b: track all the memcg children of a kmem_cache
This enables us to remove all the children of a kmem_cache being
destroyed, if for example the kernel module it's being used in gets
unloaded. Otherwise, the children will still point to the destroyed
parent.
Signed-off-by: Suleiman Souhlal <suleiman@google.com>
Signed-off-by: Glauber Costa <glommer@parallels.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Frederic Weisbecker <fweisbec@redhat.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: JoonSoo Kim <js1304@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Rik van Riel <riel@redhat.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/memcontrol.h')
-rw-r--r-- | include/linux/memcontrol.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 79fcf0cd7186..e119f3ef793c 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -454,6 +454,7 @@ struct kmem_cache * | |||
454 | __memcg_kmem_get_cache(struct kmem_cache *cachep, gfp_t gfp); | 454 | __memcg_kmem_get_cache(struct kmem_cache *cachep, gfp_t gfp); |
455 | 455 | ||
456 | void mem_cgroup_destroy_cache(struct kmem_cache *cachep); | 456 | void mem_cgroup_destroy_cache(struct kmem_cache *cachep); |
457 | void kmem_cache_destroy_memcg_children(struct kmem_cache *s); | ||
457 | 458 | ||
458 | /** | 459 | /** |
459 | * memcg_kmem_newpage_charge: verify if a new kmem allocation is allowed. | 460 | * memcg_kmem_newpage_charge: verify if a new kmem allocation is allowed. |
@@ -601,6 +602,10 @@ memcg_kmem_get_cache(struct kmem_cache *cachep, gfp_t gfp) | |||
601 | { | 602 | { |
602 | return cachep; | 603 | return cachep; |
603 | } | 604 | } |
605 | |||
606 | static inline void kmem_cache_destroy_memcg_children(struct kmem_cache *s) | ||
607 | { | ||
608 | } | ||
604 | #endif /* CONFIG_MEMCG_KMEM */ | 609 | #endif /* CONFIG_MEMCG_KMEM */ |
605 | #endif /* _LINUX_MEMCONTROL_H */ | 610 | #endif /* _LINUX_MEMCONTROL_H */ |
606 | 611 | ||