[PATCH 2/3] statm: fix negative data

From: Hugh Dickins
Date: Sun Oct 24 2004 - 10:59:02 EST


The sixth "data" field of /proc/$pid/statm was sometimes negative: text
is a subset of shared_vm, and so was subtracted twice from total_vm.

Signed-off-by: Hugh Dickins <hugh@xxxxxxxxxxx>
---
fs/proc/task_mmu.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)

--- 2.6.10-rc1/fs/proc/task_mmu.c 2004-10-23 12:44:06.000000000 +0100
+++ linux/fs/proc/task_mmu.c 2004-10-23 20:43:24.000000000 +0100
@@ -40,7 +40,7 @@ int task_statm(struct mm_struct *mm, int
*shared = mm->shared_vm;
*text = (PAGE_ALIGN(mm->end_code) - (mm->start_code & PAGE_MASK))
>> PAGE_SHIFT;
- *data = mm->total_vm - mm->shared_vm - *text;
+ *data = mm->total_vm - mm->shared_vm;
*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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/