Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1457419

Re: [PATCH] proc: much faster /proc/vmstat

From Al Viro <viro@ZenIV.linux.org.uk>
Newsgroups linux.kernel
Subject Re: [PATCH] proc: much faster /proc/vmstat
Date 2016-08-07 03:40 +0200
Message-ID <s3lei-5hH-33@gated-at.bofh.it> (permalink)
References <s3igp-3m5-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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?

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] proc: much faster /proc/vmstat Alexey Dobriyan <adobriyan@gmail.com> - 2016-08-07 00:30 +0200
  Re: [PATCH] proc: much faster /proc/vmstat Al Viro <viro@ZenIV.linux.org.uk> - 2016-08-07 03:40 +0200
    Re: [PATCH] proc: much faster /proc/vmstat Alexey Dobriyan <adobriyan@gmail.com> - 2016-08-07 10:50 +0200

csiph-web