linux/include
KAMEZAWA Hiroyuki bda7bad62b procfs: speed up /proc/pid/stat, statm
Process accounting applications as top, ps visit some files under
/proc/<pid>.  With seq_put_decimal_ull(), we can optimize /proc/<pid>/stat
and /proc/<pid>/statm files.

This patch adds
  - seq_put_decimal_ll() for signed values.
  - allow delimiter == 0.
  - convert seq_printf() to seq_put_decimal_ull/ll in /proc/stat, statm.

Test result on a system with 2000+ procs.

Before patch:
  [kamezawa@bluextal test]$ top -b -n 1 | wc -l
  2223
  [kamezawa@bluextal test]$ time top -b -n 1 > /dev/null

  real    0m0.675s
  user    0m0.044s
  sys     0m0.121s

  [kamezawa@bluextal test]$ time ps -elf > /dev/null

  real    0m0.236s
  user    0m0.056s
  sys     0m0.176s

After patch:
  kamezawa@bluextal ~]$ time top -b -n 1 > /dev/null

  real    0m0.657s
  user    0m0.052s
  sys     0m0.100s

  [kamezawa@bluextal ~]$ time ps -elf > /dev/null

  real    0m0.198s
  user    0m0.050s
  sys     0m0.145s

Considering top, ps tend to scan /proc periodically, this will reduce cpu
consumption by top/ps to some extent.

[akpm@linux-foundation.org: checkpatch fixes]
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
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
..
acpi Merge 3.3-rc2 into the driver-core-next branch. 2012-02-02 11:24:44 -08:00
asm-generic coredump: add VM_NODUMP, MADV_NODUMP, MADV_CLEAR_NODUMP 2012-03-23 16:58:42 -07:00
crypto crypto: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:16 +08:00
drm headers: include linux/types.h where appropriate 2012-03-23 16:58:31 -07:00
keys keys: add a "logon" key type 2012-01-17 22:39:40 -06:00
linux procfs: speed up /proc/pid/stat, statm 2012-03-23 16:58:42 -07:00
math-emu
media Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2012-01-18 12:53:54 -08:00
misc
mtd mtd: document that MEMWRITE ioctl is NAND-specific 2012-01-09 18:18:36 +00:00
net poll: add poll_requested_events() and poll_does_not_wait() functions 2012-03-23 16:58:38 -07:00
pcmcia
rdma Merge branches 'cma', 'cxgb3', 'cxgb4', 'ehca', 'iser', 'mad', 'nes', 'qib', 'srp' and 'srpt' into for-next 2012-03-19 09:50:33 -07:00
rxrpc
scsi headers: include linux/types.h where appropriate 2012-03-23 16:58:31 -07:00
sound headers: include linux/types.h where appropriate 2012-03-23 16:58:31 -07:00
target target: Use array_zalloc for device_list 2012-03-15 19:15:51 -07:00
trace NFS client updates for Linux 3.4 2012-03-23 08:53:47 -07:00
video fbdev: sh_mipi_dsi: add extra phyctrl for sh_mipi_dsi_info 2012-03-21 07:24:01 +00:00
xen include/ and checkpatch: prefer __scanf to __attribute__((format(scanf,...) 2012-03-23 16:58:36 -07:00
Kbuild