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

[PATCH] procfs: fix task_mmu.c text size reporting

Not all binfmts page align ->end_code and ->start_code, so the task_mmu
statistics calculations need to perform this alignment themselves.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 357dd96a
......@@ -9,7 +9,7 @@ char *task_mem(struct mm_struct *mm, char *buffer)
unsigned long data, text, lib;
data = mm->total_vm - mm->shared_vm - mm->stack_vm;
text = (mm->end_code - mm->start_code) >> 10;
text = (PAGE_ALIGN(mm->end_code) - (mm->start_code & PAGE_MASK)) >> 10;
lib = (mm->exec_vm << (PAGE_SHIFT-10)) - text;
buffer += sprintf(buffer,
"VmSize:\t%8lu kB\n"
......@@ -36,7 +36,8 @@ int task_statm(struct mm_struct *mm, int *shared, int *text,
int *data, int *resident)
{
*shared = mm->shared_vm;
*text = (mm->end_code - mm->start_code) >> PAGE_SHIFT;
*text = (PAGE_ALIGN(mm->end_code) - (mm->start_code & PAGE_MASK))
>> PAGE_SHIFT;
*data = mm->total_vm - mm->shared_vm - *text;
*resident = mm->rss;
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