Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
[pandora-kernel.git] / fs / proc / task_nommu.c
index 8f5c05d..5d9fd64 100644 (file)
@@ -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;
 }