Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264018
b: refs/heads/master
c: eb4866d
h: refs/heads/master
v: v3
  • Loading branch information
Dave Hansen authored and Linus Torvalds committed Sep 21, 2011
1 parent d7deb9c commit 9cc4406
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 38867a28a7dc9d69389990bcd42f6b7c77da3d9d
refs/heads/master: eb4866d0066ffd5446751c102d64feb3318d8bd1
21 changes: 11 additions & 10 deletions trunk/fs/proc/task_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,30 +877,31 @@ struct numa_maps_private {
struct numa_maps md;
};

static void gather_stats(struct page *page, struct numa_maps *md, int pte_dirty)
static void gather_stats(struct page *page, struct numa_maps *md, int pte_dirty,
unsigned long nr_pages)
{
int count = page_mapcount(page);

md->pages++;
md->pages += nr_pages;
if (pte_dirty || PageDirty(page))
md->dirty++;
md->dirty += nr_pages;

if (PageSwapCache(page))
md->swapcache++;
md->swapcache += nr_pages;

if (PageActive(page) || PageUnevictable(page))
md->active++;
md->active += nr_pages;

if (PageWriteback(page))
md->writeback++;
md->writeback += nr_pages;

if (PageAnon(page))
md->anon++;
md->anon += nr_pages;

if (count > md->mapcount_max)
md->mapcount_max = count;

md->node[page_to_nid(page)]++;
md->node[page_to_nid(page)] += nr_pages;
}

static int gather_pte_stats(pmd_t *pmd, unsigned long addr,
Expand Down Expand Up @@ -931,7 +932,7 @@ static int gather_pte_stats(pmd_t *pmd, unsigned long addr,
if (!node_isset(nid, node_states[N_HIGH_MEMORY]))
continue;

gather_stats(page, md, pte_dirty(*pte));
gather_stats(page, md, pte_dirty(*pte), 1);

} while (pte++, addr += PAGE_SIZE, addr != end);
pte_unmap_unlock(orig_pte, ptl);
Expand All @@ -952,7 +953,7 @@ static int gather_hugetbl_stats(pte_t *pte, unsigned long hmask,
return 0;

md = walk->private;
gather_stats(page, md, pte_dirty(*pte));
gather_stats(page, md, pte_dirty(*pte), 1);
return 0;
}

Expand Down

0 comments on commit 9cc4406

Please sign in to comment.