diff options
-rw-r--r-- | Documentation/filesystems/proc.txt | 13 | ||||
-rw-r--r-- | fs/proc/task_mmu.c | 14 |
2 files changed, 23 insertions, 4 deletions
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index fdeb5b33349f..ffcd49589ab5 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -169,6 +169,9 @@ read the file /proc/PID/status: | |||
169 | VmLck: 0 kB | 169 | VmLck: 0 kB |
170 | VmHWM: 476 kB | 170 | VmHWM: 476 kB |
171 | VmRSS: 476 kB | 171 | VmRSS: 476 kB |
172 | RssAnon: 352 kB | ||
173 | RssFile: 120 kB | ||
174 | RssShmem: 4 kB | ||
172 | VmData: 156 kB | 175 | VmData: 156 kB |
173 | VmStk: 88 kB | 176 | VmStk: 88 kB |
174 | VmExe: 68 kB | 177 | VmExe: 68 kB |
@@ -231,7 +234,12 @@ Table 1-2: Contents of the status files (as of 4.1) | |||
231 | VmSize total program size | 234 | VmSize total program size |
232 | VmLck locked memory size | 235 | VmLck locked memory size |
233 | VmHWM peak resident set size ("high water mark") | 236 | VmHWM peak resident set size ("high water mark") |
234 | VmRSS size of memory portions | 237 | VmRSS size of memory portions. It contains the three |
238 | following parts (VmRSS = RssAnon + RssFile + RssShmem) | ||
239 | RssAnon size of resident anonymous memory | ||
240 | RssFile size of resident file mappings | ||
241 | RssShmem size of resident shmem memory (includes SysV shm, | ||
242 | mapping of tmpfs and shared anonymous mappings) | ||
235 | VmData size of data, stack, and text segments | 243 | VmData size of data, stack, and text segments |
236 | VmStk size of data, stack, and text segments | 244 | VmStk size of data, stack, and text segments |
237 | VmExe size of text segment | 245 | VmExe size of text segment |
@@ -266,7 +274,8 @@ Table 1-3: Contents of the statm files (as of 2.6.8-rc3) | |||
266 | Field Content | 274 | Field Content |
267 | size total program size (pages) (same as VmSize in status) | 275 | size total program size (pages) (same as VmSize in status) |
268 | resident size of memory portions (pages) (same as VmRSS in status) | 276 | resident size of memory portions (pages) (same as VmRSS in status) |
269 | shared number of pages that are shared (i.e. backed by a file) | 277 | shared number of pages that are shared (i.e. backed by a file, same |
278 | as RssFile+RssShmem in status) | ||
270 | trs number of pages that are 'code' (not including libs; broken, | 279 | trs number of pages that are 'code' (not including libs; broken, |
271 | includes data segment) | 280 | includes data segment) |
272 | lrs number of pages of library (always 0 on 2.6) | 281 | lrs number of pages of library (always 0 on 2.6) |
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 45eb24145978..18a30aedfa5d 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -23,9 +23,13 @@ | |||
23 | 23 | ||
24 | void task_mem(struct seq_file *m, struct mm_struct *mm) | 24 | void task_mem(struct seq_file *m, struct mm_struct *mm) |
25 | { | 25 | { |
26 | unsigned long data, text, lib, swap, ptes, pmds; | 26 | unsigned long data, text, lib, swap, ptes, pmds, anon, file, shmem; |
27 | unsigned long hiwater_vm, total_vm, hiwater_rss, total_rss; | 27 | unsigned long hiwater_vm, total_vm, hiwater_rss, total_rss; |
28 | 28 | ||
29 | anon = get_mm_counter(mm, MM_ANONPAGES); | ||
30 | file = get_mm_counter(mm, MM_FILEPAGES); | ||
31 | shmem = get_mm_counter(mm, MM_SHMEMPAGES); | ||
32 | |||
29 | /* | 33 | /* |
30 | * Note: to minimize their overhead, mm maintains hiwater_vm and | 34 | * Note: to minimize their overhead, mm maintains hiwater_vm and |
31 | * hiwater_rss only when about to *lower* total_vm or rss. Any | 35 | * hiwater_rss only when about to *lower* total_vm or rss. Any |
@@ -36,7 +40,7 @@ void task_mem(struct seq_file *m, struct mm_struct *mm) | |||
36 | hiwater_vm = total_vm = mm->total_vm; | 40 | hiwater_vm = total_vm = mm->total_vm; |
37 | if (hiwater_vm < mm->hiwater_vm) | 41 | if (hiwater_vm < mm->hiwater_vm) |
38 | hiwater_vm = mm->hiwater_vm; | 42 | hiwater_vm = mm->hiwater_vm; |
39 | hiwater_rss = total_rss = get_mm_rss(mm); | 43 | hiwater_rss = total_rss = anon + file + shmem; |
40 | if (hiwater_rss < mm->hiwater_rss) | 44 | if (hiwater_rss < mm->hiwater_rss) |
41 | hiwater_rss = mm->hiwater_rss; | 45 | hiwater_rss = mm->hiwater_rss; |
42 | 46 | ||
@@ -53,6 +57,9 @@ void task_mem(struct seq_file *m, struct mm_struct *mm) | |||
53 | "VmPin:\t%8lu kB\n" | 57 | "VmPin:\t%8lu kB\n" |
54 | "VmHWM:\t%8lu kB\n" | 58 | "VmHWM:\t%8lu kB\n" |
55 | "VmRSS:\t%8lu kB\n" | 59 | "VmRSS:\t%8lu kB\n" |
60 | "RssAnon:\t%8lu kB\n" | ||
61 | "RssFile:\t%8lu kB\n" | ||
62 | "RssShmem:\t%8lu kB\n" | ||
56 | "VmData:\t%8lu kB\n" | 63 | "VmData:\t%8lu kB\n" |
57 | "VmStk:\t%8lu kB\n" | 64 | "VmStk:\t%8lu kB\n" |
58 | "VmExe:\t%8lu kB\n" | 65 | "VmExe:\t%8lu kB\n" |
@@ -66,6 +73,9 @@ void task_mem(struct seq_file *m, struct mm_struct *mm) | |||
66 | mm->pinned_vm << (PAGE_SHIFT-10), | 73 | mm->pinned_vm << (PAGE_SHIFT-10), |
67 | hiwater_rss << (PAGE_SHIFT-10), | 74 | hiwater_rss << (PAGE_SHIFT-10), |
68 | total_rss << (PAGE_SHIFT-10), | 75 | total_rss << (PAGE_SHIFT-10), |
76 | anon << (PAGE_SHIFT-10), | ||
77 | file << (PAGE_SHIFT-10), | ||
78 | shmem << (PAGE_SHIFT-10), | ||
69 | data << (PAGE_SHIFT-10), | 79 | data << (PAGE_SHIFT-10), |
70 | mm->stack_vm << (PAGE_SHIFT-10), text, lib, | 80 | mm->stack_vm << (PAGE_SHIFT-10), text, lib, |
71 | ptes >> 10, | 81 | ptes >> 10, |