Forum Search:
OpenVZ Forum
Members
Search
Help
Register
Login
Home
Home
»
Mailing lists
»
Devel
»
[PATCH v2 00/29] kmem limitation for memcg
Show:
Today's Messages
::
Show Polls
::
Message Navigator
E-mail to friend
[PATCH v2 27/29] slub: create slabinfo file for memcg
[
message #46327
is a reply to
message #46299
]
Fri, 11 May 2012 17:44
Glauber Costa
Messages:
916
Registered:
October 2011
Senior Member
This patch implements mem_cgroup_slabinfo() for the slub.
With that, we can also probe the used caches for it.
Signed-off-by: Glauber Costa <
glommer@parallels.com
>
CC: Christoph Lameter <
cl@linux.com
>
CC: Pekka Enberg <
penberg@cs.helsinki.fi
>
CC: Michal Hocko <
mhocko@suse.cz
>
CC: Kamezawa Hiroyuki <
kamezawa.hiroyu@jp.fujitsu.com
>
CC: Johannes Weiner <
hannes@cmpxchg.org
>
CC: Suleiman Souhlal <
suleiman@google.com
>
---
mm/slub.c | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index 0efcd77..afe29ef 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4159,6 +4159,33 @@ struct kmem_cache *kmem_cache_dup(struct mem_cgroup *memcg,
int mem_cgroup_slabinfo(struct mem_cgroup *memcg, struct seq_file *m)
{
+ struct kmem_cache *s;
+ int node;
+ unsigned long nr_objs = 0;
+ unsigned long nr_free = 0;
+
+ seq_printf(m, "# name <active_objs> <num_objs> <objsize>\n");
+
+ down_read(&slub_lock);
+ list_for_each_entry(s, &slab_caches, list) {
+ if (s->memcg_params.memcg != memcg)
+ continue;
+
+ for_each_online_node(node) {
+ struct kmem_cache_node *n = get_node(s, node);
+
+ if (!n)
+ continue;
+
+ nr_objs += atomic_long_read(&n->total_objects);
+ nr_free += count_partial(n, count_free);
+ }
+
+ seq_printf(m, "%-17s %6lu %6lu %6u\n", s->name,
+ nr_objs - nr_free, nr_objs, s->size);
+ }
+ up_read(&slub_lock);
+
return 0;
}
#endif
--
1.7.7.6
Report message to a moderator
[
Message index
]
[PATCH v2 00/29] kmem limitation for memcg
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 03/29] memcg: Always free struct memcg through schedule_work()
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 07/29] memcg: Reclaim when more than one page needed.
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 09/29] memcg: change defines to an enum
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 01/29] slab: dup name string
By:
Glauber Costa
on Fri, 11 May 2012 17:44
Re: [PATCH v2 01/29] slab: dup name string
By:
David Rientjes
on Tue, 15 May 2012 22:04
Re: [PATCH v2 01/29] slab: dup name string
By:
Glauber Costa
on Wed, 16 May 2012 06:12
[PATCH v2 10/29] res_counter: don't force return value checking in res_counter_charge_nofail
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 02/29] slub: fix slab_state for slub
By:
Glauber Costa
on Fri, 11 May 2012 17:44
Re: [PATCH v2 02/29] slub: fix slab_state for slub
By:
Christoph Lameter
on Fri, 11 May 2012 17:51
Re: [PATCH v2 02/29] slub: fix slab_state for slub
By:
David Rientjes
on Tue, 15 May 2012 21:55
Re: [PATCH v2 02/29] slub: fix slab_state for slub
By:
Glauber Costa
on Wed, 16 May 2012 06:10
Re: [PATCH v2 02/29] slub: fix slab_state for slub
By:
Glauber Costa
on Thu, 17 May 2012 10:14
[PATCH v2 06/29] memcg: Make it possible to use the stock for more than one page.
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 04/29] slub: always get the cache from its page in kfree
By:
Glauber Costa
on Fri, 11 May 2012 17:44
Re: [PATCH v2 04/29] slub: always get the cache from its page in kfree
By:
Christoph Lameter
on Fri, 11 May 2012 17:53
Re: [PATCH v2 04/29] slub: always get the cache from its page in kfree
By:
Glauber Costa
on Fri, 11 May 2012 17:57
Re: [PATCH v2 04/29] slub: always get the cache from its page in kfree
By:
Christoph Lameter
on Fri, 11 May 2012 18:06
Re: [PATCH v2 04/29] slub: always get the cache from its page in kfree
By:
Glauber Costa
on Fri, 11 May 2012 18:11
Re: [PATCH v2 04/29] slub: always get the cache from its page in kfree
By:
Christoph Lameter
on Fri, 11 May 2012 18:17
Re: [PATCH v2 04/29] slub: always get the cache from its page in kfree
By:
Glauber Costa
on Fri, 11 May 2012 18:20
Re: [PATCH v2 04/29] slub: always get the cache from its page in kfree
By:
Christoph Lameter
on Fri, 11 May 2012 18:32
Re: [PATCH v2 04/29] slub: always get the cache from its page in kfree
By:
Glauber Costa
on Fri, 11 May 2012 18:42
Re: [PATCH v2 04/29] slub: always get the cache from its page in kfree
By:
Christoph Lameter
on Fri, 11 May 2012 18:56
Re: [PATCH v2 04/29] slub: always get the cache from its page in kfree
By:
Glauber Costa
on Fri, 11 May 2012 18:58
Re: [PATCH v2 04/29] slub: always get the cache from its page in kfree
By:
Christoph Lameter
on Fri, 11 May 2012 19:09
Re: [PATCH v2 04/29] slub: always get the cache from its page in kfree
By:
Glauber Costa
on Fri, 11 May 2012 19:11
Re: [PATCH v2 04/29] slub: always get the cache from its page in kfree
By:
Christoph Lameter
on Fri, 11 May 2012 19:20
Re: [PATCH v2 04/29] slub: always get the cache from its page in kfree
By:
Glauber Costa
on Fri, 11 May 2012 19:24
[PATCH v2 12/29] kmem slab accounting basic infrastructure
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 05/29] slab: rename gfpflags to allocflags
By:
Glauber Costa
on Fri, 11 May 2012 17:44
Re: [PATCH v2 05/29] slab: rename gfpflags to allocflags
By:
Christoph Lameter
on Fri, 11 May 2012 17:54
Re: [PATCH v2 05/29] slab: rename gfpflags to allocflags
By:
David Rientjes
on Tue, 15 May 2012 21:57
[PATCH v2 11/29] cgroups: ability to stop res charge propagation on bounded ancestor
By:
Glauber Costa
on Fri, 11 May 2012 17:44
Re: [PATCH v2 11/29] cgroups: ability to stop res charge propagation on bounded ancestor
By:
KAMEZAWA Hiroyuki
on Tue, 15 May 2012 02:59
Re: [PATCH v2 11/29] cgroups: ability to stop res charge propagation on bounded ancestor
By:
Glauber Costa
on Wed, 16 May 2012 06:16
[PATCH v2 08/29] slab: use obj_size field of struct kmem_cache when not debugging
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 13/29] slab/slub: struct memcg_params
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 14/29] slub: consider a memcg parameter in kmem_create_cache
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 15/29] slab: pass memcg parameter to kmem_cache_create
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 16/29] slub: create duplicate cache
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 25/29] memcg: Track all the memcg children of a kmem_cache.
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 17/29] slab: create duplicate cache
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 26/29] memcg: Per-memcg memory.kmem.slabinfo file.
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 18/29] memcg: kmem controller charge/uncharge infrastructure
By:
Glauber Costa
on Fri, 11 May 2012 17:44
Re: [PATCH v2 18/29] memcg: kmem controller charge/uncharge infrastructure
By:
KAMEZAWA Hiroyuki
on Tue, 15 May 2012 02:57
Re: [PATCH v2 18/29] memcg: kmem controller charge/uncharge infrastructure
By:
Glauber Costa
on Wed, 16 May 2012 06:42
Re: [PATCH v2 18/29] memcg: kmem controller charge/uncharge infrastructure
By:
KAMEZAWA Hiroyuki
on Wed, 16 May 2012 08:18
Re: [PATCH v2 18/29] memcg: kmem controller charge/uncharge infrastructure
By:
Glauber Costa
on Wed, 16 May 2012 08:25
Re: [PATCH v2 18/29] memcg: kmem controller charge/uncharge infrastructure
By:
KAMEZAWA Hiroyuki
on Wed, 16 May 2012 09:15
[PATCH v2 19/29] skip memcg kmem allocations in specified code regions
By:
Glauber Costa
on Fri, 11 May 2012 17:44
Re: [PATCH v2 19/29] skip memcg kmem allocations in specified code regions
By:
KAMEZAWA Hiroyuki
on Tue, 15 May 2012 02:46
Re: [PATCH v2 19/29] skip memcg kmem allocations in specified code regions
By:
Glauber Costa
on Wed, 16 May 2012 06:19
Re: [PATCH v2 19/29] skip memcg kmem allocations in specified code regions
By:
KAMEZAWA Hiroyuki
on Wed, 16 May 2012 07:55
[PATCH v2 20/29] slub: charge allocation to a memcg
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 21/29] slab: per-memcg accounting of slab caches
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 22/29] memcg: disable kmem code when not in use.
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 23/29] memcg: destroy memcg caches
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 24/29] memcg/slub: shrink dead caches
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 27/29] slub: create slabinfo file for memcg
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 28/29] slub: track all children of a kmem cache
By:
Glauber Costa
on Fri, 11 May 2012 17:44
[PATCH v2 29/29] Documentation: add documentation for slab tracker for memcg
By:
Glauber Costa
on Fri, 11 May 2012 17:44
Re: [PATCH v2 00/29] kmem limitation for memcg
By:
Glauber Costa
on Fri, 11 May 2012 18:05
Previous Topic:
[PATCH RFC 00/13] Lockd: grace period containerization
Next Topic:
[PATCH v5 0/2] fix static_key disabling problem in memcg
Goto Forum:
- General
Virtuozzo 7 Beta Program
Support
HowTo
Discussions
- Mailing lists
Users
Devel
- International
German
French
Russian
- Test
TestForum
ml-test
-=]
Back to Top
[=-
[
Syndicate this forum (XML)
] [
] [
]
Current Time:
Sun Aug 17 22:34:17 GMT 2025
Total time taken to generate the page: 0.46407 seconds