Messages in this thread Patch in this message | | | Date | Tue, 24 Aug 2004 10:05:47 -0700 | From | William Lee Irwin III <> | Subject | fix text reporting in O(1) proc_pid_statm() |
| |
On Tue, Aug 24, 2004 at 12:55:39AM -0700, William Lee Irwin III wrote: > 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. > Incremental atop the task_vsize() de-mmap_sem-ification of 2.6.8.1-mm4:
Some kind of brainfart happened here, though it's not visible on the default display from top(1) etc. This patch fixes up the gibberish I mistakenly put down for text with the proper text size, and subtracts it from data as per the O(vmas) code beforehand.
Index: mm4-2.6.8.1/fs/proc/task_mmu.c =================================================================== --- mm4-2.6.8.1.orig/fs/proc/task_mmu.c 2004-08-23 18:29:33.000000000 -0700 +++ mm4-2.6.8.1/fs/proc/task_mmu.c 2004-08-24 10:00:21.530755896 -0700 @@ -36,8 +36,8 @@ int *data, int *resident) { *shared = mm->shared_vm; - *text = mm->exec_vm - ((mm->end_code - mm->start_code) >> PAGE_SHIFT); - *data = mm->total_vm - mm->shared_vm; + *text = (mm->end_code - mm->start_code) >> PAGE_SHIFT; + *data = mm->total_vm - mm->shared_vm - *text; *resident = mm->rss; return mm->total_vm; } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |