Commit 9e54345f authored by Steven J. Magnani's avatar Steven J. Magnani Committed by james toy

On no-MMU systems, sizes reported in /proc/n/statm have units of bytes.

Per Documentation/filesystems/proc.txt, these values should be in pages.
Signed-off-by: default avatarSteven J. Magnani <steve@digidescorp.com>
Cc: Greg Ungerer <gerg@snapgear.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 9f5673f2
......@@ -110,8 +110,11 @@ int task_statm(struct mm_struct *mm, int *shared, int *text,
}
}
size += (*text = mm->end_code - mm->start_code);
size += (*data = mm->start_stack - mm->start_data);
size >>= PAGE_SHIFT;
*text = (PAGE_ALIGN(mm->end_code) - (mm->start_code & PAGE_MASK))
>> PAGE_SHIFT;
*data = (mm->start_stack - mm->start_data) >> PAGE_SHIFT;
size += *text + *data;
up_read(&mm->mmap_sem);
*resident = size;
return size;
......
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