aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/task_nommu.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/task_nommu.c')
-rw-r--r--fs/proc/task_nommu.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
index 8f5c05d3dbd3..46d4b5d72bd3 100644
--- a/fs/proc/task_nommu.c
+++ b/fs/proc/task_nommu.c
@@ -5,6 +5,7 @@
5#include <linux/fs_struct.h> 5#include <linux/fs_struct.h>
6#include <linux/mount.h> 6#include <linux/mount.h>
7#include <linux/ptrace.h> 7#include <linux/ptrace.h>
8#include <linux/slab.h>
8#include <linux/seq_file.h> 9#include <linux/seq_file.h>
9#include "internal.h" 10#include "internal.h"
10 11
@@ -110,9 +111,13 @@ int task_statm(struct mm_struct *mm, int *shared, int *text,
110 } 111 }
111 } 112 }
112 113
113 size += (*text = mm->end_code - mm->start_code); 114 *text = (PAGE_ALIGN(mm->end_code) - (mm->start_code & PAGE_MASK))
114 size += (*data = mm->start_stack - mm->start_data); 115 >> PAGE_SHIFT;
116 *data = (PAGE_ALIGN(mm->start_stack) - (mm->start_data & PAGE_MASK))
117 >> PAGE_SHIFT;
115 up_read(&mm->mmap_sem); 118 up_read(&mm->mmap_sem);
119 size >>= PAGE_SHIFT;
120 size += *text + *data;
116 *resident = size; 121 *resident = size;
117 return size; 122 return size;
118} 123}