diff options
author | Steven J. Magnani <steve@digidescorp.com> | 2009-12-14 21:00:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-15 11:53:24 -0500 |
commit | 7e1e0ef22c9ba9f797d7c4448feee722584bba5c (patch) | |
tree | 892fd5374f4815891065f148617fefc601e19219 /fs/proc/task_nommu.c | |
parent | ea637639591def87a54cea811cbac796980cb30d (diff) |
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: Steven J. Magnani <steve@digidescorp.com>
Cc: Greg Ungerer <gerg@snapgear.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/task_nommu.c')
-rw-r--r-- | fs/proc/task_nommu.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c index 8f5c05d3dbd3..5d9fd64ef81a 100644 --- a/fs/proc/task_nommu.c +++ b/fs/proc/task_nommu.c | |||
@@ -110,9 +110,13 @@ int task_statm(struct mm_struct *mm, int *shared, int *text, | |||
110 | } | 110 | } |
111 | } | 111 | } |
112 | 112 | ||
113 | size += (*text = mm->end_code - mm->start_code); | 113 | *text = (PAGE_ALIGN(mm->end_code) - (mm->start_code & PAGE_MASK)) |
114 | size += (*data = mm->start_stack - mm->start_data); | 114 | >> PAGE_SHIFT; |
115 | *data = (PAGE_ALIGN(mm->start_stack) - (mm->start_data & PAGE_MASK)) | ||
116 | >> PAGE_SHIFT; | ||
115 | up_read(&mm->mmap_sem); | 117 | up_read(&mm->mmap_sem); |
118 | size >>= PAGE_SHIFT; | ||
119 | size += *text + *data; | ||
116 | *resident = size; | 120 | *resident = size; |
117 | return size; | 121 | return size; |
118 | } | 122 | } |