Messages in this thread |  | | Date | Tue, 31 Jan 2012 08:58:20 +0900 | | From | KAMEZAWA Hiroyuki <> | | Subject | Re: [PATCH] Add num_to_str() for speedup /proc/stat |
| |
On Mon, 30 Jan 2012 15:20:51 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
> On Mon, 30 Jan 2012 14:16:19 +0900 > KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote: > > > From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > Date: Mon, 30 Jan 2012 14:15:12 +0900 > > Subject: [PATCH] Add num_to_str() for speedup /proc/stat > > On my 8cpu box. > > == Before patch == > > [root@bluextal test]# time ./stat_check.py > > > > real 0m0.150s > > user 0m0.026s > > sys 0m0.121s > > > > == After patch == > > [root@bluextal test]# time ./stat_check.py > > > > real 0m0.055s > > user 0m0.022s > > sys 0m0.030s > > > > Maybe it's worth to add this simple function. > > I suppose so - the new infrastructure can be used elsewhere. > > I tried doing the > > if (kstst_irqs(j) == 0) { > seq_putc(p, ' '); > seq_putc(p, '0'); > > think on top of this and didn't observe any improvement. > > > I made some changes - please review. I'm not sure why you did "char > tmp[66]"? > Your fix seems fine to me. I'm sorry I copied tmp[66] from number()..
and yes, 0xffffffffffffffff=18446744073709551615 , tmp[21] will be enough.
I'll prepare patch for /proc/<pid>/stat and see 'ps' and 'top' performance.
Thanks, -Kame
|  |