All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] proc: much faster /proc/vmstat
Date: Sun, 7 Aug 2016 02:35:13 +0100	[thread overview]
Message-ID: <20160807013510.GM2356@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20160806125455.GA1187@p183.telecom.by>

On Sat, Aug 06, 2016 at 03:54:56PM +0300, Alexey Dobriyan wrote:

[sprintf sucks, let's convert numbers manually]

> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -1592,7 +1592,10 @@ static int vmstat_show(struct seq_file *m, void *arg)
>  {
>  	unsigned long *l = arg;
>  	unsigned long off = l - (unsigned long *)m->private;
> -	seq_printf(m, "%s %lu\n", vmstat_text[off], *l);
> +
> +	seq_puts(m, vmstat_text[off]);
> +	seq_put_decimal_ull(m, ' ', *l);
> +	seq_putc(m, '\n');
>  	return 0;
>  }

If that manages to be a hotspot, we really should
	* educate the wankers responsible for the userland code in question,
until they repent and cease committing such abominations.
	* look into fixing vsnprintf().  

Seriously, what the hell is vsnprintf() doing that takes so much time?  It's
not as if it was a complex format anyway.  WTF is going on there?  Where is
it spending that much time?

  reply	other threads:[~2016-08-07  1:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-06 12:54 [PATCH] proc: much faster /proc/vmstat Alexey Dobriyan
2016-08-07  1:35 ` Al Viro [this message]
2016-08-07  8:42   ` Alexey Dobriyan

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=20160807013510.GM2356@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.