Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309743
b: refs/heads/master
c: bca1554
h: refs/heads/master
i:
  309741: 87d7776
  309739: b7b1922
  309735: a069790
  309727: e4f18fb
v: v3
  • Loading branch information
Konstantin Khlebnikov authored and Linus Torvalds committed Jun 1, 2012
1 parent 7d67407 commit 70e36d3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b1d4d9e0cbd0aecf40c3572e0c8f98de31b3b328
refs/heads/master: bca15543736f9be6d84e0bbc262ea7069076b9e6
12 changes: 12 additions & 0 deletions trunk/fs/proc/task_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ struct mem_size_stats {
unsigned long anonymous;
unsigned long anonymous_thp;
unsigned long swap;
unsigned long nonlinear;
u64 pss;
};

Expand All @@ -402,6 +403,7 @@ static void smaps_pte_entry(pte_t ptent, unsigned long addr,
{
struct mem_size_stats *mss = walk->private;
struct vm_area_struct *vma = mss->vma;
pgoff_t pgoff = linear_page_index(vma, addr);
struct page *page = NULL;
int mapcount;

Expand All @@ -414,6 +416,9 @@ static void smaps_pte_entry(pte_t ptent, unsigned long addr,
mss->swap += ptent_size;
else if (is_migration_entry(swpent))
page = migration_entry_to_page(swpent);
} else if (pte_file(ptent)) {
if (pte_to_pgoff(ptent) != pgoff)
mss->nonlinear += ptent_size;
}

if (!page)
Expand All @@ -422,6 +427,9 @@ static void smaps_pte_entry(pte_t ptent, unsigned long addr,
if (PageAnon(page))
mss->anonymous += ptent_size;

if (page->index != pgoff)
mss->nonlinear += ptent_size;

mss->resident += ptent_size;
/* Accumulate the size in pages that have been accessed. */
if (pte_young(ptent) || PageReferenced(page))
Expand Down Expand Up @@ -523,6 +531,10 @@ static int show_smap(struct seq_file *m, void *v, int is_pid)
(vma->vm_flags & VM_LOCKED) ?
(unsigned long)(mss.pss >> (10 + PSS_SHIFT)) : 0);

if (vma->vm_flags & VM_NONLINEAR)
seq_printf(m, "Nonlinear: %8lu kB\n",
mss.nonlinear >> 10);

if (m->count < m->size) /* vma is copied successfully */
m->version = (vma != get_gate_vma(task->mm))
? vma->vm_start : 0;
Expand Down

0 comments on commit 70e36d3

Please sign in to comment.