]> git.baikalelectronics.ru Git - kernel.git/commit
proc: speed up /proc/*/statm
authorAlexey Dobriyan <adobriyan@gmail.com>
Tue, 7 Apr 2020 03:09:05 +0000 (20:09 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 7 Apr 2020 17:43:42 +0000 (10:43 -0700)
commit6159d0fd3d7ae43c0c7d15d0fb7c84817da5b804
tree9a68b7a199b7b287098b3197850fbff446bdcfb5
parente04c06c0e14790f34054205b83f9b3207cb1d328
proc: speed up /proc/*/statm

top(1) reads all /proc/*/statm files but kernel threads will always have
zeros.  Print those zeroes directly without going through
seq_put_decimal_ull().

Speed up reading /proc/2/statm (which is kthreadd) is like 3%.

My system has more kernel threads than normal processes after booting KDE.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/20200307154435.GA2788@avx2
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/array.c