linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: ? ? <mordorw@hotmail.com>
Cc: "cl@linux.com" <cl@linux.com>, "linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH] slab: fix /proc/slabinfo alignment
Date: Tue, 20 Feb 2018 09:49:02 +0100	[thread overview]
Message-ID: <20180220084902.GT21134@dhcp22.suse.cz> (raw)
In-Reply-To: <BM1PR0101MB2083C73A6E7608B630CE4C26B1CF0@BM1PR0101MB2083.INDPRD01.PROD.OUTLOOK.COM>

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>

  reply	other threads:[~2018-02-20  8:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20  2:29 ? ?
2018-02-20  8:49 ` Michal Hocko [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180220084902.GT21134@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=cl@linux.com \
    --cc=linux-mm@kvack.org \
    --cc=mordorw@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox