From 9683ede17eb15e7477659031b5eba076dccaf451 Mon Sep 17 00:00:00 2001 From: William Lee Irwin III Date: Thu, 26 Aug 2004 20:36:27 -0700 Subject: [PATCH] [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: Andrew Morton Signed-off-by: Linus Torvalds --- fs/proc/task_mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 2eb61f3c896b8..73693b6d4324c 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -36,8 +36,8 @@ int task_statm(struct mm_struct *mm, int *shared, int *text, 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; } -- 2.53.0