Forum Search:
OpenVZ Forum
Members
Search
Help
Register
Login
Home
Home
»
Mailing lists
»
Devel
»
[PATCH 00/23] slab+slub accounting for memcg
Show:
Today's Messages
::
Show Polls
::
Message Navigator
E-mail to friend
[PATCH 23/23] slub: create slabinfo file for memcg
[
message #46023
is a reply to
message #45989
]
Sun, 22 April 2012 23:53
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 1031d4d..495a4f1 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4150,6 +4150,33 @@ void kmem_cache_drop_ref(struct kmem_cache *s)
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 00/23] slab+slub accounting for memcg
By:
Glauber Costa
on Fri, 20 April 2012 21:57
[PATCH 02/23] slub: always get the cache from its page in kfree
By:
Glauber Costa
on Fri, 20 April 2012 21:57
[PATCH 04/23] memcg: Make it possible to use the stock for more than one page.
By:
Glauber Costa
on Fri, 20 April 2012 21:57
Re: [PATCH 04/23] memcg: Make it possible to use the stock for more than one page.
By:
KAMEZAWA Hiroyuki
on Wed, 25 April 2012 00:59
[PATCH 03/23] slab: rename gfpflags to allocflags
By:
Glauber Costa
on Fri, 20 April 2012 21:57
[PATCH 07/23] change defines to an enum
By:
Glauber Costa
on Fri, 20 April 2012 21:57
Re: [PATCH 07/23] change defines to an enum
By:
KAMEZAWA Hiroyuki
on Wed, 25 April 2012 01:18
[PATCH 05/23] memcg: Reclaim when more than one page needed.
By:
Glauber Costa
on Fri, 20 April 2012 21:57
Re: [PATCH 05/23] memcg: Reclaim when more than one page needed.
By:
KAMEZAWA Hiroyuki
on Wed, 25 April 2012 01:16
[PATCH 09/23] kmem slab accounting basic infrastructure
By:
Glauber Costa
on Fri, 20 April 2012 21:57
Re: [PATCH 09/23] kmem slab accounting basic infrastructure
By:
KAMEZAWA Hiroyuki
on Wed, 25 April 2012 01:32
Re: [PATCH 09/23] kmem slab accounting basic infrastructure
By:
Glauber Costa
on Wed, 25 April 2012 14:38
Re: [PATCH 09/23] kmem slab accounting basic infrastructure
By:
KAMEZAWA Hiroyuki
on Thu, 26 April 2012 00:08
Re: [PATCH 09/23] kmem slab accounting basic infrastructure
By:
Suleiman Souhlal
on Mon, 30 April 2012 19:33
Re: [PATCH 09/23] kmem slab accounting basic infrastructure
By:
Glauber Costa
on Wed, 02 May 2012 15:15
[PATCH 08/23] don't force return value checking in res_counter_charge_nofail
By:
Glauber Costa
on Fri, 20 April 2012 21:57
Re: [PATCH 08/23] don't force return value checking in res_counter_charge_nofail
By:
KAMEZAWA Hiroyuki
on Wed, 25 April 2012 01:28
[PATCH 06/23] slab: use obj_size field of struct kmem_cache when not debugging
By:
Glauber Costa
on Fri, 20 April 2012 21:57
[PATCH 01/23] slub: don't create a copy of the name string in kmem_cache_create
By:
Glauber Costa
on Fri, 20 April 2012 21:57
[PATCH 10/23] slab/slub: struct memcg_params
By:
Glauber Costa
on Fri, 20 April 2012 21:57
Re: [PATCH 10/23] slab/slub: struct memcg_params
By:
Suleiman Souhlal
on Mon, 30 April 2012 19:42
[PATCH 11/23] slub: consider a memcg parameter in kmem_create_cache
By:
Glauber Costa
on Fri, 20 April 2012 21:57
Re: [PATCH 11/23] slub: consider a memcg parameter in kmem_create_cache
By:
Frederic Weisbecker
on Tue, 24 April 2012 14:03
Re: [PATCH 11/23] slub: consider a memcg parameter in kmem_create_cache
By:
Glauber Costa
on Tue, 24 April 2012 14:27
Re: [PATCH 11/23] slub: consider a memcg parameter in kmem_create_cache
By:
KAMEZAWA Hiroyuki
on Wed, 25 April 2012 01:38
Re: [PATCH 11/23] slub: consider a memcg parameter in kmem_create_cache
By:
Glauber Costa
on Wed, 25 April 2012 14:37
Re: [PATCH 11/23] slub: consider a memcg parameter in kmem_create_cache
By:
Suleiman Souhlal
on Mon, 30 April 2012 19:51
Re: [PATCH 11/23] slub: consider a memcg parameter in kmem_create_cache
By:
Glauber Costa
on Wed, 02 May 2012 15:18
[PATCH 12/23] slab: pass memcg parameter to kmem_cache_create
By:
Glauber Costa
on Sun, 22 April 2012 23:53
Re: [PATCH 12/23] slab: pass memcg parameter to kmem_cache_create
By:
Suleiman Souhlal
on Mon, 30 April 2012 19:54
[PATCH 21/23] memcg: Track all the memcg children of a kmem_cache.
By:
Glauber Costa
on Sun, 22 April 2012 23:53
[PATCH 13/23] slub: create duplicate cache
By:
Glauber Costa
on Sun, 22 April 2012 23:53
Re: [PATCH 13/23] slub: create duplicate cache
By:
Frederic Weisbecker
on Tue, 24 April 2012 14:18
Re: [PATCH 13/23] slub: create duplicate cache
By:
Glauber Costa
on Tue, 24 April 2012 14:37
Re: [PATCH 13/23] slub: create duplicate cache
By:
Frederic Weisbecker
on Thu, 26 April 2012 13:10
Re: [PATCH 13/23] slub: create duplicate cache
By:
Suleiman Souhlal
on Mon, 30 April 2012 20:15
[PATCH 15/23] slab: create duplicate cache
By:
Glauber Costa
on Sun, 22 April 2012 23:53
[PATCH 14/23] slub: provide kmalloc_no_account
By:
Glauber Costa
on Sun, 22 April 2012 23:53
[PATCH 22/23] memcg: Per-memcg memory.kmem.slabinfo file.
By:
Glauber Costa
on Sun, 22 April 2012 23:53
[PATCH 16/23] slab: provide kmalloc_no_account
By:
Glauber Costa
on Sun, 22 April 2012 23:53
Re: [PATCH 16/23] slab: provide kmalloc_no_account
By:
KAMEZAWA Hiroyuki
on Wed, 25 April 2012 01:44
Re: [PATCH 16/23] slab: provide kmalloc_no_account
By:
Glauber Costa
on Wed, 25 April 2012 14:29
Re: [PATCH 16/23] slab: provide kmalloc_no_account
By:
KAMEZAWA Hiroyuki
on Thu, 26 April 2012 00:13
[PATCH 18/23] slub: charge allocation to a memcg
By:
Glauber Costa
on Sun, 22 April 2012 23:53
[PATCH 17/23] kmem controller charge/uncharge infrastructure
By:
Glauber Costa
on Sun, 22 April 2012 23:53
Re: [PATCH 17/23] kmem controller charge/uncharge infrastructure
By:
David Rientjes
on Mon, 23 April 2012 22:25
Re: [PATCH 17/23] kmem controller charge/uncharge infrastructure
By:
Frederic Weisbecker
on Tue, 24 April 2012 14:22
Re: [PATCH 17/23] kmem controller charge/uncharge infrastructure
By:
Glauber Costa
on Tue, 24 April 2012 14:40
Re: [PATCH 17/23] kmem controller charge/uncharge infrastructure
By:
David Rientjes
on Tue, 24 April 2012 20:25
Re: [PATCH 17/23] kmem controller charge/uncharge infrastructure
By:
Glauber Costa
on Tue, 24 April 2012 21:36
Re: [PATCH 17/23] kmem controller charge/uncharge infrastructure
By:
David Rientjes
on Tue, 24 April 2012 22:54
Re: [PATCH 17/23] kmem controller charge/uncharge infrastructure
By:
Glauber Costa
on Wed, 25 April 2012 14:43
Re: [PATCH 17/23] kmem controller charge/uncharge infrastructure
By:
David Rientjes
on Tue, 24 April 2012 20:21
Re: [PATCH 17/23] kmem controller charge/uncharge infrastructure
By:
Frederic Weisbecker
on Fri, 27 April 2012 11:38
Re: [PATCH 17/23] kmem controller charge/uncharge infrastructure
By:
David Rientjes
on Fri, 27 April 2012 18:13
Re: [PATCH 17/23] kmem controller charge/uncharge infrastructure
By:
KAMEZAWA Hiroyuki
on Wed, 25 April 2012 01:56
Re: [PATCH 17/23] kmem controller charge/uncharge infrastructure
By:
Glauber Costa
on Wed, 25 April 2012 14:44
Re: [PATCH 17/23] kmem controller charge/uncharge infrastructure
By:
Frederic Weisbecker
on Fri, 27 April 2012 12:22
Re: [PATCH 17/23] kmem controller charge/uncharge infrastructure
By:
Suleiman Souhlal
on Mon, 30 April 2012 20:56
Re: [PATCH 17/23] kmem controller charge/uncharge infrastructure
By:
Glauber Costa
on Wed, 02 May 2012 15:34
[PATCH 19/23] slab: per-memcg accounting of slab caches
By:
Glauber Costa
on Sun, 22 April 2012 23:53
Re: [PATCH 19/23] slab: per-memcg accounting of slab caches
By:
Suleiman Souhlal
on Mon, 30 April 2012 21:25
Re: [PATCH 19/23] slab: per-memcg accounting of slab caches
By:
Glauber Costa
on Wed, 02 May 2012 15:40
[PATCH 23/23] slub: create slabinfo file for memcg
By:
Glauber Costa
on Sun, 22 April 2012 23:53
[PATCH 20/23] memcg: disable kmem code when not in use.
By:
Glauber Costa
on Sun, 22 April 2012 23:53
Re: [PATCH 00/23] slab+slub accounting for memcg
By:
Glauber Costa
on Sun, 22 April 2012 23:59
[PATCH 0/3] A few fixes for '[PATCH 00/23] slab+slub accounting for memcg' series
By:
Anton Vorontsov
on Mon, 30 April 2012 09:59
[PATCH 1/3] slab: Proper off-slabs handling when duplicating caches
By:
Anton Vorontsov
on Mon, 30 April 2012 10:01
[PATCH 2/3] slab: Fix imbalanced rcu locking
By:
Anton Vorontsov
on Mon, 30 April 2012 10:01
[PATCH 3/3] slab: Get rid of mem_cgroup_put_kmem_cache()
By:
Anton Vorontsov
on Mon, 30 April 2012 10:02
Previous Topic:
[PATCH 00/23] slab+slub accounting for memcg
Next Topic:
[PATCH v3 0/2] SUNRPC: separate per-net data creation from service
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:
Mon Nov 24 15:58:31 GMT 2025
Total time taken to generate the page: 0.30361 seconds