projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ea63763
)
procfs: use proper units for noMMU statm
author
Steven J. Magnani
<
[email protected]
>
Tue, 15 Dec 2009 02:00:04 +0000
(18:00 -0800)
committer
Linus Torvalds
<
[email protected]
>
Tue, 15 Dec 2009 16:53:24 +0000
(08:53 -0800)
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 <
[email protected]
>
Cc: Greg Ungerer <
[email protected]
>
Cc: David Howells <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
fs/proc/task_nommu.c
patch
|
blob
|
history
diff --git
a/fs/proc/task_nommu.c
b/fs/proc/task_nommu.c
index 8f5c05d3dbd3e2aaa4abcd3fcc92af79e324daca..5d9fd64ef81a9ad76b1525943cc34a79b0a6a33d 100644
(file)
--- 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,
}
}
- size += (*text = mm->end_code - mm->start_code);
- size += (*data = mm->start_stack - mm->start_data);
+ *text = (PAGE_ALIGN(mm->end_code) - (mm->start_code & PAGE_MASK))
+ >> PAGE_SHIFT;
+ *data = (PAGE_ALIGN(mm->start_stack) - (mm->start_data & PAGE_MASK))
+ >> PAGE_SHIFT;
up_read(&mm->mmap_sem);
+ size >>= PAGE_SHIFT;
+ size += *text + *data;
*resident = size;
return size;
}