memcglist_lru-duplicate-lrus-upon-kmemcg-creation.patch removed from -mm tree
Subsystems (5)
[email protected]
maintainerSubject: [to-be-updated] memcglist_lru-duplicate-lrus-upon-kmemcg-creation.patch removed from -mm tree
To: [email protected],[email protected],[email protected]
From: [email protected]
Date: Thu, 06 Jun 2013 12:35:11 -0700
The patch titled
Subject: memcg,list_lru: duplicate LRUs upon kmemcg creation
has been removed from the -mm tree. Its filename was
memcglist_lru-duplicate-lrus-upon-kmemcg-creation.patch
This patch was dropped because an updated version will be merged
------------------------------------------------------
From: Glauber Costa <[email protected]>
Subject: memcg,list_lru: duplicate LRUs upon kmemcg creation
When a new memcg is created, we need to open up room for its descriptors in all of the list_lrus that are marked per-memcg. The process is quite similar to the one we are using for the kmem caches: we initialize the new structures in an array indexed by kmemcg_id, and grow the array if needed.
Key data like the size of the array will be shared between the kmem cache
code and the list_lru code (they basically describe the same thing)
---
include/linux/list_lru.h | 48 ++++++++++- include/linux/memcontrol.h | 12 ++ lib/list_lru.c | 102 +++++++++++++++++++++-- mm/memcontrol.c | 151 +++++++++++++++++++++++++++++++++-- mm/slab_common.c | 1 5 files changed, 297 insertions(+), 17 deletions(-)
include/linux/list_lru.h renamed from include/linux/list_lru.h~memcglist_lru-duplicate-lrus-upon-kmemcg-creation +47 -1
@@ -24,6 +24,23 @@ struct list_lru_node {long nr_items; }____cacheline_aligned_in_smp ; +/* +* This is supposed to be M x N matrix, where M is kmem-limited memcg, and N is +* the number of nodes. Both dimensions are likely to be very small, but are +* potentially very big. Therefore we will allocate or grow them dynamically. +* +* The size of M will increase as new memcgs appear and can be 0 if no memcgs +* are being used. This is done in mm/memcontrol.c in a way quite similar than +* the way we use for the slab cache management. +* +* The size o N can't be determined at compile time, but won't increase once we +* determine it. It is nr_node_ids, the firmware-provided maximum number of +* nodes in a system. +*/ +struct list_lru_array { +struct list_lru_node node[1 ]; +}; +struct list_lru {/* * Because we use a fixed-size array, this struct can be very big if
@@ -37,9 +54,38 @@ struct list_lru {*/ struct list_lru_node node[MAX_NUMNODES ];nodemask_t active_nodes; +#ifdef CONFIG_MEMCG_KMEM +/* All memcg-aware LRUs will be chained in the lrus list */ +struct list_head lrus; +/* M x N matrix as described above */ +struct list_lru_array **memcg_lrus; +#endif }; -int list_lru_init (struct list_lru *lru); +struct mem_cgroup ; +#ifdef CONFIG_MEMCG_KMEM +struct list_lru_array *lru_alloc_array (void ); +int memcg_update_all_lrus (unsigned long num); +void memcg_destroy_all_lrus (struct mem_cgroup *memcg); +void list_lru_destroy (struct list_lru *lru); +int __memcg_init_lru (struct list_lru *lru); +#else +static inline void list_lru_destroy (struct list_lru *lru) +{ +} +#endif + +int __list_lru_init (struct list_lru *lru,bool memcg_enabled); +static inline int list_lru_init (struct list_lru *lru) +{ +return __list_lru_init (lru, false); +} + +static inline int list_lru_init_memcg (struct list_lru *lru) +{ +return __list_lru_init (lru, true); +} +int list_lru_add (struct list_lru *lru,struct list_head *item);int list_lru_del (struct list_lru *lru,struct list_head *item);
include/linux/memcontrol.h renamed from include/linux/memcontrol.h~memcglist_lru-duplicate-lrus-upon-kmemcg-creation +12 -0
@@ -23,6 +23,7 @@#include <linux/vm_event_item.h> #include <linux/hardirq.h> #include <linux/jump_label.h> +#include <linux/list_lru.h> struct mem_cgroup ;struct page_cgroup ;
@@ -470,6 +471,12 @@ void memcg_update_array_size(int num_grostruct kmem_cache *__memcg_kmem_get_cache (struct kmem_cache *cachep,gfp_t gfp); +int memcg_new_lru (struct list_lru *lru); +int memcg_init_lru (struct list_lru *lru); + +int memcg_kmem_update_lru_size (struct list_lru *lru,int num_groups, +bool new_lru); +void mem_cgroup_destroy_cache (struct kmem_cache *cachep);void kmem_cache_destroy_memcg_children (struct kmem_cache *s);
@@ -633,6 +640,11 @@ memcg_kmem_get_cache(struct kmem_cache *static inline void kmem_cache_destroy_memcg_children (struct kmem_cache *s) { } + +static inline int memcg_init_lru (struct list_lru *lru) +{ +return 0 ; +}#endif /* CONFIG_MEMCG_KMEM */ #endif /* _LINUX_MEMCONTROL_H */
lib/list_lru.c renamed from lib/list_lru.c~memcglist_lru-duplicate-lrus-upon-kmemcg-creation +93 -9
123 lines not on this page · raw message
mm/memcontrol.c renamed from mm/memcontrol.c~memcglist_lru-duplicate-lrus-upon-kmemcg-creation +145 -6
175 lines not on this page · raw message
mm/slab_common.c renamed from mm/slab_common.c~memcglist_lru-duplicate-lrus-upon-kmemcg-creation +0 -1
@@ -102,7 +102,6 @@ int memcg_update_all_caches(int num_memc goto out; } -memcg_update_array_size (num_memcgs); out:mutex_unlock (&slab_mutex);return ret;
_
Patches currently in -mm which might be from [email protected] are
lru-add-an-element-to-a-memcg-list.patch list_lru-per-memcg-walks.patch memcg-per-memcg-kmem-shrinking.patch memcg-scan-cache-objects-hierarchically.patch vmscan-take-at-least-one-pass-with-shrinkers.patch super-targeted-memcg-reclaim.patch memcg-move-initialization-to-memcg-creation.patch vmpressure-in-kernel-notifications.patch memcg-reap-dead-memcgs-upon-global-memory-pressure.patch