Eric Dumazet 59a32e2ce5 proc: speed up /proc/stat handling
On a typical 16 cpus machine, "cat /proc/stat" gives more than 4096 bytes,
and is slow :

  # strace -T -o /tmp/STRACE cat /proc/stat | wc -c
  5826
  # grep "cpu " /tmp/STRACE
  read(0, "cpu  1949310 19 2144714 12117253"..., 32768) = 5826 <0.001504>

Thats partly because show_stat() must be called twice since initial
buffer size is too small (4096 bytes for less than 32 possible cpus)

Fix this by :

 1) Taking into account nr_irqs in the initial buffer sizing.

 2) Using ksize() to allow better filling of initial buffer.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Glauber Costa <glommer@parallels.com>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Paul Turner <pjt@google.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-03-23 16:58:42 -07:00
..
2012-03-21 13:54:22 -07:00
2012-03-21 10:15:51 -07:00
2012-03-21 10:15:51 -07:00
2012-03-23 08:53:47 -07:00
2012-03-23 08:53:47 -07:00
2012-03-23 16:58:42 -07:00
2012-03-23 09:24:07 -07:00
2012-03-20 21:29:52 -04:00
2012-03-20 21:29:38 -04:00
2012-03-23 09:27:40 -07:00
2012-01-03 22:55:11 -05:00
2012-01-03 22:54:54 -05:00
2012-03-20 21:29:46 -04:00
2012-03-20 21:29:46 -04:00
2012-02-08 22:07:18 +01:00
2012-01-03 22:54:07 -05:00
2012-01-03 22:52:39 -05:00
2012-03-20 21:29:51 -04:00
2012-01-05 15:40:12 -08:00
2012-03-20 21:29:38 -04:00
2011-10-31 17:30:44 -07:00
2011-11-02 12:53:43 +01:00
2012-03-20 21:29:41 -04:00
2012-01-03 22:53:07 -05:00
2012-01-03 22:54:07 -05:00
2012-01-03 22:52:40 -05:00