* [PATCH] slab: fix /proc/slabinfo alignment
@ 2018-02-20 2:29 ? ?
2018-02-20 8:49 ` Michal Hocko
2018-02-20 14:56 ` Christopher Lameter
0 siblings, 2 replies; 10+ messages in thread
From: ? ? @ 2018-02-20 2:29 UTC (permalink / raw)
To: cl@linux.com; +Cc: linux-mm@kvack.org, ? ?
Signed-off-by: mordor <mordorw@hotmail.com>
/proc/slabinfo is not aligned, it is difficult to read, so correct it
---
mm/slab_common.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 10f127b..7111549 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -1232,7 +1232,6 @@ void cache_random_seq_destroy(struct kmem_cache *cachep)
#else
#define SLABINFO_RIGHTS S_IRUSR
#endif
-
static void print_slabinfo_header(struct seq_file *m)
{
/*
@@ -1244,7 +1243,7 @@ static void print_slabinfo_header(struct seq_file *m)
#else
seq_puts(m, "slabinfo - version: 2.1\n");
#endif
- seq_puts(m, "# name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab>");
+ seq_puts(m, "# name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab>");
seq_puts(m, " : tunables <limit> <batchcount> <sharedfactor>");
seq_puts(m, " : slabdata <active_slabs> <num_slabs> <sharedavail>");
#ifdef CONFIG_DEBUG_SLAB
@@ -1291,6 +1290,7 @@ memcg_accumulate_slabinfo(struct kmem_cache *s, struct slabinfo *info)
}
}
+
static void cache_show(struct kmem_cache *s, struct seq_file *m)
{
struct slabinfo sinfo;
@@ -1300,13 +1300,13 @@ static void cache_show(struct kmem_cache *s, struct seq_file *m)
memcg_accumulate_slabinfo(s, &sinfo);
- seq_printf(m, "%-17s %6lu %6lu %6u %4u %4d",
+ seq_printf(m, "%-30s %13lu %10lu %9u %12u %14d",
cache_name(s), sinfo.active_objs, sinfo.num_objs, s->size,
sinfo.objects_per_slab, (1 << sinfo.cache_order));
- seq_printf(m, " : tunables %4u %4u %4u",
+ seq_printf(m, " : tunables %7u %12u %14u",
sinfo.limit, sinfo.batchcount, sinfo.shared);
- seq_printf(m, " : slabdata %6lu %6lu %6lu",
+ seq_printf(m, " : slabdata %14lu %11lu %13lu",
sinfo.active_slabs, sinfo.num_slabs, sinfo.shared_avail);
slabinfo_show_stats(m, s);
seq_putc(m, '\n');
--
2.7.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] slab: fix /proc/slabinfo alignment
2018-02-20 2:29 [PATCH] slab: fix /proc/slabinfo alignment ? ?
@ 2018-02-20 8:49 ` Michal Hocko
2018-02-20 14:56 ` Christopher Lameter
1 sibling, 0 replies; 10+ messages in thread
From: Michal Hocko @ 2018-02-20 8:49 UTC (permalink / raw)
To: ? ?; +Cc: cl@linux.com, linux-mm@kvack.org
On Tue 20-02-18 02:29:13, ? ? wrote:
> Signed-off-by: mordor <mordorw@hotmail.com>
> /proc/slabinfo is not aligned, it is difficult to read, so correct it
I do not see this as an improvement, to be honest. Moreover you risk a
regression when some dumb parsing tool relies on the current layout
format. I find the later rather unlikely but there would have to be a
very good reason to take the risk.
> ---
> mm/slab_common.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/mm/slab_common.c b/mm/slab_common.c
> index 10f127b..7111549 100644
> --- a/mm/slab_common.c
> +++ b/mm/slab_common.c
> @@ -1232,7 +1232,6 @@ void cache_random_seq_destroy(struct kmem_cache *cachep)
> #else
> #define SLABINFO_RIGHTS S_IRUSR
> #endif
> -
> static void print_slabinfo_header(struct seq_file *m)
> {
> /*
> @@ -1244,7 +1243,7 @@ static void print_slabinfo_header(struct seq_file *m)
> #else
> seq_puts(m, "slabinfo - version: 2.1\n");
> #endif
> - seq_puts(m, "# name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab>");
> + seq_puts(m, "# name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab>");
> seq_puts(m, " : tunables <limit> <batchcount> <sharedfactor>");
> seq_puts(m, " : slabdata <active_slabs> <num_slabs> <sharedavail>");
> #ifdef CONFIG_DEBUG_SLAB
> @@ -1291,6 +1290,7 @@ memcg_accumulate_slabinfo(struct kmem_cache *s, struct slabinfo *info)
> }
> }
>
> +
> static void cache_show(struct kmem_cache *s, struct seq_file *m)
> {
> struct slabinfo sinfo;
> @@ -1300,13 +1300,13 @@ static void cache_show(struct kmem_cache *s, struct seq_file *m)
>
> memcg_accumulate_slabinfo(s, &sinfo);
>
> - seq_printf(m, "%-17s %6lu %6lu %6u %4u %4d",
> + seq_printf(m, "%-30s %13lu %10lu %9u %12u %14d",
> cache_name(s), sinfo.active_objs, sinfo.num_objs, s->size,
> sinfo.objects_per_slab, (1 << sinfo.cache_order));
>
> - seq_printf(m, " : tunables %4u %4u %4u",
> + seq_printf(m, " : tunables %7u %12u %14u",
> sinfo.limit, sinfo.batchcount, sinfo.shared);
> - seq_printf(m, " : slabdata %6lu %6lu %6lu",
> + seq_printf(m, " : slabdata %14lu %11lu %13lu",
> sinfo.active_slabs, sinfo.num_slabs, sinfo.shared_avail);
> slabinfo_show_stats(m, s);
> seq_putc(m, '\n');
> --
> 2.7.4
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
--
Michal Hocko
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] slab: fix /proc/slabinfo alignment
2018-02-20 2:29 [PATCH] slab: fix /proc/slabinfo alignment ? ?
2018-02-20 8:49 ` Michal Hocko
@ 2018-02-20 14:56 ` Christopher Lameter
2018-02-20 15:04 ` Matthew Wilcox
1 sibling, 1 reply; 10+ messages in thread
From: Christopher Lameter @ 2018-02-20 14:56 UTC (permalink / raw)
To: ? ?; +Cc: linux-mm@kvack.org
On Tue, 20 Feb 2018, ? ? wrote:
> /proc/slabinfo is not aligned, it is difficult to read, so correct it
How does it look on a terminal with 80 characters per line?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] slab: fix /proc/slabinfo alignment
2018-02-20 14:56 ` Christopher Lameter
@ 2018-02-20 15:04 ` Matthew Wilcox
2018-02-20 16:05 ` Christopher Lameter
0 siblings, 1 reply; 10+ messages in thread
From: Matthew Wilcox @ 2018-02-20 15:04 UTC (permalink / raw)
To: Christopher Lameter; +Cc: ? ?, linux-mm@kvack.org
On Tue, Feb 20, 2018 at 08:56:11AM -0600, Christopher Lameter wrote:
> On Tue, 20 Feb 2018, ? ? wrote:
>
> > /proc/slabinfo is not aligned, it is difficult to read, so correct it
>
> How does it look on a terminal with 80 characters per line?
That ship sailed long ago ...
kmalloc-8192 433 435 8192 1 2 : tunables 8 4 0 : sla
bdata 433 435 0
(I put in a manual carriage return at 80 columns for those not reading on
an 80 column terminal).
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] slab: fix /proc/slabinfo alignment
2018-02-20 15:04 ` Matthew Wilcox
@ 2018-02-20 16:05 ` Christopher Lameter
2018-02-20 16:11 ` Matthew Wilcox
0 siblings, 1 reply; 10+ messages in thread
From: Christopher Lameter @ 2018-02-20 16:05 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: ? ?, linux-mm@kvack.org
On Tue, 20 Feb 2018, Matthew Wilcox wrote:
> On Tue, Feb 20, 2018 at 08:56:11AM -0600, Christopher Lameter wrote:
> > On Tue, 20 Feb 2018, ? ? wrote:
> >
> > > /proc/slabinfo is not aligned, it is difficult to read, so correct it
> >
> > How does it look on a terminal with 80 characters per line?
>
> That ship sailed long ago ...
>
> kmalloc-8192 433 435 8192 1 2 : tunables 8 4 0 : sla
> bdata 433 435 0
>
> (I put in a manual carriage return at 80 columns for those not reading on
> an 80 column terminal).
Well yes but if someone is fixing things then the 80 character issue also
should be fixed.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] slab: fix /proc/slabinfo alignment
2018-02-20 16:05 ` Christopher Lameter
@ 2018-02-20 16:11 ` Matthew Wilcox
2018-02-20 16:23 ` Christopher Lameter
0 siblings, 1 reply; 10+ messages in thread
From: Matthew Wilcox @ 2018-02-20 16:11 UTC (permalink / raw)
To: Christopher Lameter; +Cc: ? ?, linux-mm@kvack.org
On Tue, Feb 20, 2018 at 10:05:23AM -0600, Christopher Lameter wrote:
> On Tue, 20 Feb 2018, Matthew Wilcox wrote:
>
> > On Tue, Feb 20, 2018 at 08:56:11AM -0600, Christopher Lameter wrote:
> > > On Tue, 20 Feb 2018, ? ? wrote:
> > >
> > > > /proc/slabinfo is not aligned, it is difficult to read, so correct it
> > >
> > > How does it look on a terminal with 80 characters per line?
> >
> > That ship sailed long ago ...
> >
> > kmalloc-8192 433 435 8192 1 2 : tunables 8 4 0 : sla
> > bdata 433 435 0
> >
> > (I put in a manual carriage return at 80 columns for those not reading on
> > an 80 column terminal).
>
> Well yes but if someone is fixing things then the 80 character issue also
> should be fixed.
I don't think it's fixable; there's just too much information per slab.
Anyway, I preferred the solution you & I were working on to limit the
length of names to 16 bytes, except for the cgroup slabs.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] slab: fix /proc/slabinfo alignment
2018-02-20 16:11 ` Matthew Wilcox
@ 2018-02-20 16:23 ` Christopher Lameter
2018-02-20 18:36 ` Matthew Wilcox
0 siblings, 1 reply; 10+ messages in thread
From: Christopher Lameter @ 2018-02-20 16:23 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: ? ?, linux-mm@kvack.org
On Tue, 20 Feb 2018, Matthew Wilcox wrote:
> I don't think it's fixable; there's just too much information per slab.
> Anyway, I preferred the solution you & I were working on to limit the
> length of names to 16 bytes, except for the cgroup slabs.
So what do we do with the cgroup slab names? have a slabinfo per cgroup?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] slab: fix /proc/slabinfo alignment
2018-02-20 16:23 ` Christopher Lameter
@ 2018-02-20 18:36 ` Matthew Wilcox
2018-02-20 18:43 ` Christopher Lameter
0 siblings, 1 reply; 10+ messages in thread
From: Matthew Wilcox @ 2018-02-20 18:36 UTC (permalink / raw)
To: Christopher Lameter; +Cc: ? ?, linux-mm@kvack.org
On Tue, Feb 20, 2018 at 10:23:41AM -0600, Christopher Lameter wrote:
> On Tue, 20 Feb 2018, Matthew Wilcox wrote:
>
> > I don't think it's fixable; there's just too much information per slab.
> > Anyway, I preferred the solution you & I were working on to limit the
> > length of names to 16 bytes, except for the cgroup slabs.
>
> So what do we do with the cgroup slab names? have a slabinfo per cgroup?
What I had in mind ...
struct kmem_cache_attr {
const char name[16];
unsigned int size;
unsigned int align;
unsigned int useroffset;
unsigned int usersize;
slab_flags_t flags;
kmem_cache_ctor ctor;
}
struct kmem_cache {
const struct kmem_cache_attr *a;
const char *name;
...
};
In kmem_cache_create_usercopy:
s->name = a->name;
In memcg_create_kmem_cache:
s->name = kasprintf(GFP_KERNEL, "%s(%llu:%s)", a->name,
css->serial_nr, memcg_name_buf);
In slab_kmem_cache_release:
if (s->name != s->a->name)
kfree_const(s->name);
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] slab: fix /proc/slabinfo alignment
2018-02-20 18:36 ` Matthew Wilcox
@ 2018-02-20 18:43 ` Christopher Lameter
2018-02-20 19:19 ` Matthew Wilcox
0 siblings, 1 reply; 10+ messages in thread
From: Christopher Lameter @ 2018-02-20 18:43 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: ? ?, linux-mm@kvack.org
On Tue, 20 Feb 2018, Matthew Wilcox wrote:
> In memcg_create_kmem_cache:
>
> s->name = kasprintf(GFP_KERNEL, "%s(%llu:%s)", a->name,
> css->serial_nr, memcg_name_buf);
>
But that creates the long name that shows up in /proc/slabinfo.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] slab: fix /proc/slabinfo alignment
2018-02-20 18:43 ` Christopher Lameter
@ 2018-02-20 19:19 ` Matthew Wilcox
0 siblings, 0 replies; 10+ messages in thread
From: Matthew Wilcox @ 2018-02-20 19:19 UTC (permalink / raw)
To: Christopher Lameter; +Cc: ? ?, linux-mm@kvack.org
On Tue, Feb 20, 2018 at 12:43:52PM -0600, Christopher Lameter wrote:
> On Tue, 20 Feb 2018, Matthew Wilcox wrote:
>
> > In memcg_create_kmem_cache:
> >
> > s->name = kasprintf(GFP_KERNEL, "%s(%llu:%s)", a->name,
> > css->serial_nr, memcg_name_buf);
> >
>
> But that creates the long name that shows up in /proc/slabinfo.
Yes. People who enable cgroups get an ugly /proc/slabinfo. I don't have
a solution to that, but at least those of us who don't enable cgroups will
no longer have:
drm_i915_gem_request 243 357 576 7 1 : tunables 54 27 8 : slabdata 51 51 0
fat_cache 0 0 32 124 1 : tunables 120 60 8 : slabdata 0 0 0
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2018-02-20 19:19 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-20 2:29 [PATCH] slab: fix /proc/slabinfo alignment ? ?
2018-02-20 8:49 ` Michal Hocko
2018-02-20 14:56 ` Christopher Lameter
2018-02-20 15:04 ` Matthew Wilcox
2018-02-20 16:05 ` Christopher Lameter
2018-02-20 16:11 ` Matthew Wilcox
2018-02-20 16:23 ` Christopher Lameter
2018-02-20 18:36 ` Matthew Wilcox
2018-02-20 18:43 ` Christopher Lameter
2018-02-20 19:19 ` Matthew Wilcox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).