]> git.hungrycats.org Git - linux/commit
[PATCH] O(1) proc_pid_statm()
authorWilliam Lee Irwin III <wli@holomorphy.com>
Fri, 27 Aug 2004 03:36:15 +0000 (20:36 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 27 Aug 2004 03:36:15 +0000 (20:36 -0700)
commit6ac0a8d7d5033027e0ae999525d11750ee4337ca
tree2e5f5eb30e6f5946a877fc2455db3355846aea84
parent384aabda4b2051245ce44df0ecb538617644e32e
[PATCH] O(1) proc_pid_statm()

Merely removing down_read(&mm->mmap_sem) from task_vsize() is too
half-assed to let stand. The following patch removes the vma iteration
as well as the down_read(&mm->mmap_sem) from both task_mem() and
task_statm() and callers for the CONFIG_MMU=y case in favor of
accounting the various stats reported at the times of vma creation,
destruction, and modification. Unlike the 2.4.x patches of the same
name, this has no per-pte-modification overhead whatsoever.

This patch quashes end user complaints of top(1) being slow as well as
kernel hacker complaints of per-pte accounting overhead simultaneously.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 files changed:
arch/ia64/ia32/binfmt_elf32.c
arch/ia64/kernel/perfmon.c
arch/ia64/mm/fault.c
arch/s390/kernel/compat_exec.c
arch/x86_64/ia32/ia32_binfmt.c
fs/exec.c
fs/proc/array.c
fs/proc/task_mmu.c
fs/proc/task_nommu.c
include/linux/mm.h
include/linux/proc_fs.h
include/linux/sched.h
mm/mmap.c
mm/mprotect.c
mm/mremap.c