aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/task_mmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/task_mmu.c')
-rw-r--r--fs/proc/task_mmu.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index f4ab76c7c662..7415eeb7cc3a 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -338,8 +338,7 @@ const struct file_operations proc_maps_operations = {
338#define PSS_SHIFT 12 338#define PSS_SHIFT 12
339 339
340#ifdef CONFIG_PROC_PAGE_MONITOR 340#ifdef CONFIG_PROC_PAGE_MONITOR
341struct mem_size_stats 341struct mem_size_stats {
342{
343 struct vm_area_struct *vma; 342 struct vm_area_struct *vma;
344 unsigned long resident; 343 unsigned long resident;
345 unsigned long shared_clean; 344 unsigned long shared_clean;
@@ -347,6 +346,7 @@ struct mem_size_stats
347 unsigned long private_clean; 346 unsigned long private_clean;
348 unsigned long private_dirty; 347 unsigned long private_dirty;
349 unsigned long referenced; 348 unsigned long referenced;
349 unsigned long swap;
350 u64 pss; 350 u64 pss;
351}; 351};
352 352
@@ -363,6 +363,12 @@ static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
363 pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); 363 pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
364 for (; addr != end; pte++, addr += PAGE_SIZE) { 364 for (; addr != end; pte++, addr += PAGE_SIZE) {
365 ptent = *pte; 365 ptent = *pte;
366
367 if (is_swap_pte(ptent)) {
368 mss->swap += PAGE_SIZE;
369 continue;
370 }
371
366 if (!pte_present(ptent)) 372 if (!pte_present(ptent))
367 continue; 373 continue;
368 374
@@ -421,7 +427,8 @@ static int show_smap(struct seq_file *m, void *v)
421 "Shared_Dirty: %8lu kB\n" 427 "Shared_Dirty: %8lu kB\n"
422 "Private_Clean: %8lu kB\n" 428 "Private_Clean: %8lu kB\n"
423 "Private_Dirty: %8lu kB\n" 429 "Private_Dirty: %8lu kB\n"
424 "Referenced: %8lu kB\n", 430 "Referenced: %8lu kB\n"
431 "Swap: %8lu kB\n",
425 (vma->vm_end - vma->vm_start) >> 10, 432 (vma->vm_end - vma->vm_start) >> 10,
426 mss.resident >> 10, 433 mss.resident >> 10,
427 (unsigned long)(mss.pss >> (10 + PSS_SHIFT)), 434 (unsigned long)(mss.pss >> (10 + PSS_SHIFT)),
@@ -429,7 +436,8 @@ static int show_smap(struct seq_file *m, void *v)
429 mss.shared_dirty >> 10, 436 mss.shared_dirty >> 10,
430 mss.private_clean >> 10, 437 mss.private_clean >> 10,
431 mss.private_dirty >> 10, 438 mss.private_dirty >> 10,
432 mss.referenced >> 10); 439 mss.referenced >> 10,
440 mss.swap >> 10);
433 441
434 return ret; 442 return ret;
435} 443}