Commit 9683ede1 authored by William Lee Irwin III's avatar William Lee Irwin III Committed by Linus Torvalds

[PATCH] fix text reporting in O(1) proc_pid_statm()

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.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6ac0a8d7
...@@ -36,8 +36,8 @@ int task_statm(struct mm_struct *mm, int *shared, int *text, ...@@ -36,8 +36,8 @@ int task_statm(struct mm_struct *mm, int *shared, int *text,
int *data, int *resident) int *data, int *resident)
{ {
*shared = mm->shared_vm; *shared = mm->shared_vm;
*text = mm->exec_vm - ((mm->end_code - mm->start_code) >> PAGE_SHIFT); *text = (mm->end_code - mm->start_code) >> PAGE_SHIFT;
*data = mm->total_vm - mm->shared_vm; *data = mm->total_vm - mm->shared_vm - *text;
*resident = mm->rss; *resident = mm->rss;
return mm->total_vm; return mm->total_vm;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment