提交 7e1e0ef2 编写于 作者: S Steven J. Magnani 提交者: Linus Torvalds

procfs: use proper units for noMMU statm

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: NSteven J. Magnani <steve@digidescorp.com>
Cc: Greg Ungerer <gerg@snapgear.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 ea637639
...@@ -110,9 +110,13 @@ int task_statm(struct mm_struct *mm, int *shared, int *text, ...@@ -110,9 +110,13 @@ int task_statm(struct mm_struct *mm, int *shared, int *text,
} }
} }
size += (*text = mm->end_code - mm->start_code); *text = (PAGE_ALIGN(mm->end_code) - (mm->start_code & PAGE_MASK))
size += (*data = mm->start_stack - mm->start_data); >> PAGE_SHIFT;
*data = (PAGE_ALIGN(mm->start_stack) - (mm->start_data & PAGE_MASK))
>> PAGE_SHIFT;
up_read(&mm->mmap_sem); up_read(&mm->mmap_sem);
size >>= PAGE_SHIFT;
size += *text + *data;
*resident = size; *resident = size;
return size; return size;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册