[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170517141146.11063-2-richard.weiyang@gmail.com>
Date: Wed, 17 May 2017 22:11:41 +0800
From: Wei Yang <richard.weiyang@...il.com>
To: cl@...ux.com, penberg@...nel.org, rientjes@...gle.com,
akpm@...ux-foundation.org
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Wei Yang <richard.weiyang@...il.com>
Subject: [PATCH 1/6] mm/slub: add total_objects_partial sysfs
For partial slabs, show_slab_objects could display its total objects.
This patch just adds an entry to display it.
Signed-off-by: Wei Yang <richard.weiyang@...il.com>
---
mm/slub.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/mm/slub.c b/mm/slub.c
index a7a109247730..1100d2e75870 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4983,6 +4983,12 @@ static ssize_t objects_partial_show(struct kmem_cache *s, char *buf)
}
SLAB_ATTR_RO(objects_partial);
+static ssize_t total_objects_partial_show(struct kmem_cache *s, char *buf)
+{
+ return show_slab_objects(s, buf, SO_PARTIAL|SO_TOTAL);
+}
+SLAB_ATTR_RO(total_objects_partial);
+
static ssize_t slabs_cpu_partial_show(struct kmem_cache *s, char *buf)
{
int objects = 0;
@@ -5359,6 +5365,7 @@ static struct attribute *slab_attrs[] = {
&cpu_partial_attr.attr,
&objects_attr.attr,
&objects_partial_attr.attr,
+ &total_objects_partial_attr.attr,
&partial_attr.attr,
&cpu_slabs_attr.attr,
&ctor_attr.attr,
--
2.11.0
Powered by blists - more mailing lists