diff options
Diffstat (limited to 'fs/proc/task_mmu.c')
-rw-r--r-- | fs/proc/task_mmu.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 9d22c1c1caa8..199088ee969b 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -120,6 +120,7 @@ struct mem_size_stats | |||
120 | unsigned long shared_dirty; | 120 | unsigned long shared_dirty; |
121 | unsigned long private_clean; | 121 | unsigned long private_clean; |
122 | unsigned long private_dirty; | 122 | unsigned long private_dirty; |
123 | unsigned long referenced; | ||
123 | }; | 124 | }; |
124 | 125 | ||
125 | struct pmd_walker { | 126 | struct pmd_walker { |
@@ -188,18 +189,20 @@ static int show_map_internal(struct seq_file *m, void *v, struct mem_size_stats | |||
188 | 189 | ||
189 | if (mss) | 190 | if (mss) |
190 | seq_printf(m, | 191 | seq_printf(m, |
191 | "Size: %8lu kB\n" | 192 | "Size: %8lu kB\n" |
192 | "Rss: %8lu kB\n" | 193 | "Rss: %8lu kB\n" |
193 | "Shared_Clean: %8lu kB\n" | 194 | "Shared_Clean: %8lu kB\n" |
194 | "Shared_Dirty: %8lu kB\n" | 195 | "Shared_Dirty: %8lu kB\n" |
195 | "Private_Clean: %8lu kB\n" | 196 | "Private_Clean: %8lu kB\n" |
196 | "Private_Dirty: %8lu kB\n", | 197 | "Private_Dirty: %8lu kB\n" |
198 | "Pgs_Referenced: %8lu kB\n", | ||
197 | (vma->vm_end - vma->vm_start) >> 10, | 199 | (vma->vm_end - vma->vm_start) >> 10, |
198 | mss->resident >> 10, | 200 | mss->resident >> 10, |
199 | mss->shared_clean >> 10, | 201 | mss->shared_clean >> 10, |
200 | mss->shared_dirty >> 10, | 202 | mss->shared_dirty >> 10, |
201 | mss->private_clean >> 10, | 203 | mss->private_clean >> 10, |
202 | mss->private_dirty >> 10); | 204 | mss->private_dirty >> 10, |
205 | mss->referenced >> 10); | ||
203 | 206 | ||
204 | if (m->count < m->size) /* vma is copied successfully */ | 207 | if (m->count < m->size) /* vma is copied successfully */ |
205 | m->version = (vma != get_gate_vma(task))? vma->vm_start: 0; | 208 | m->version = (vma != get_gate_vma(task))? vma->vm_start: 0; |
@@ -232,6 +235,9 @@ static void smaps_one_pmd(struct vm_area_struct *vma, pmd_t *pmd, | |||
232 | if (!page) | 235 | if (!page) |
233 | continue; | 236 | continue; |
234 | 237 | ||
238 | /* Accumulate the size in pages that have been accessed. */ | ||
239 | if (pte_young(ptent) || PageReferenced(page)) | ||
240 | mss->referenced += PAGE_SIZE; | ||
235 | if (page_mapcount(page) >= 2) { | 241 | if (page_mapcount(page) >= 2) { |
236 | if (pte_dirty(ptent)) | 242 | if (pte_dirty(ptent)) |
237 | mss->shared_dirty += PAGE_SIZE; | 243 | mss->shared_dirty += PAGE_SIZE; |