"Node %d Writeback: %8lu kB\n"
"Node %d FilePages: %8lu kB\n"
"Node %d Mapped: %8lu kB\n"
+ "Node %d AnonPages: %8lu kB\n"
"Node %d Slab: %8lu kB\n",
nid, K(i.totalram),
nid, K(i.freeram),
nid, K(ps.nr_writeback),
nid, K(node_page_state(nid, NR_FILE_PAGES)),
nid, K(node_page_state(nid, NR_FILE_MAPPED)),
+ nid, K(node_page_state(nid, NR_ANON_PAGES)),
nid, K(ps.nr_slab));
n += hugetlb_report_node_meminfo(nid, buf + n);
return n;
"SwapFree: %8lu kB\n"
"Dirty: %8lu kB\n"
"Writeback: %8lu kB\n"
+ "AnonPages: %8lu kB\n"
"Mapped: %8lu kB\n"
"Slab: %8lu kB\n"
"CommitLimit: %8lu kB\n"
K(i.freeswap),
K(ps.nr_dirty),
K(ps.nr_writeback),
+ K(global_page_state(NR_ANON_PAGES)),
K(global_page_state(NR_FILE_MAPPED)),
K(ps.nr_slab),
K(allowed),
#endif
enum zone_stat_item {
- NR_FILE_MAPPED, /* mapped into pagetables.
+ NR_ANON_PAGES, /* Mapped anonymous pages */
+ NR_FILE_MAPPED, /* pagecache pages mapped into pagetables.
only modified from process context */
NR_FILE_PAGES,
NR_VM_ZONE_STAT_ITEMS };
{
wbs->nr_dirty = read_page_state(nr_dirty);
wbs->nr_unstable = read_page_state(nr_unstable);
- wbs->nr_mapped = global_page_state(NR_FILE_MAPPED);
+ wbs->nr_mapped = global_page_state(NR_FILE_MAPPED) +
+ global_page_state(NR_ANON_PAGES);
wbs->nr_writeback = read_page_state(nr_writeback);
}
* nr_mapped state can be updated without turning off
* interrupts because it is not modified via interrupt.
*/
- __inc_zone_page_state(page, NR_FILE_MAPPED);
+ __inc_zone_page_state(page, NR_ANON_PAGES);
}
/**
*/
if (page_test_and_clear_dirty(page))
set_page_dirty(page);
- __dec_zone_page_state(page, NR_FILE_MAPPED);
+ __dec_zone_page_state(page,
+ PageAnon(page) ? NR_ANON_PAGES : NR_FILE_MAPPED);
}
}
* how much memory
* is mapped.
*/
- mapped_ratio = (global_page_state(NR_FILE_MAPPED) * 100) /
+ mapped_ratio = ((global_page_state(NR_FILE_MAPPED) +
+ global_page_state(NR_ANON_PAGES)) * 100) /
vm_total_pages;
/*
static char *vmstat_text[] = {
/* Zoned VM counters */
+ "nr_anon_pages",
"nr_mapped",
"nr_file_pages",