Commit 596c3a20 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] remove nr_reverse_maps VM accounting

Maintaining the `nr_reverse_maps' provides makes a small but
measurable decrease in page_add_rmap() overhead.

I don't think it's a very useful metric, and it can be sort-of inferred from
slabinfo.
parent 7ffbbaf2
......@@ -177,8 +177,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
"Mapped: %8lu kB\n"
"Slab: %8lu kB\n"
"Committed_AS: %8u kB\n"
"PageTables: %8lu kB\n"
"ReverseMaps: %8lu\n",
"PageTables: %8lu kB\n",
K(i.totalram),
K(i.freeram),
K(i.bufferram),
......@@ -197,8 +196,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
K(ps.nr_mapped),
K(ps.nr_slab),
K(committed),
K(ps.nr_page_table_pages),
ps.nr_reverse_maps
K(ps.nr_page_table_pages)
);
len += hugetlb_report_meminfo(page + len);
......
......@@ -83,7 +83,6 @@ struct page_state {
unsigned long nr_dirty; /* Dirty writeable pages */
unsigned long nr_writeback; /* Pages under writeback */
unsigned long nr_page_table_pages;/* Pages used for pagetables */
unsigned long nr_reverse_maps; /* includes PageDirect */
unsigned long nr_mapped; /* mapped into pagetables */
unsigned long nr_slab; /* In slab */
#define GET_PAGE_STATE_LAST nr_slab
......
......@@ -1432,7 +1432,6 @@ static char *vmstat_text[] = {
"nr_dirty",
"nr_writeback",
"nr_page_table_pages",
"nr_reverse_maps",
"nr_mapped",
"nr_slab",
......
......@@ -209,8 +209,6 @@ page_add_rmap(struct page *page, pte_t *ptep, struct pte_chain *pte_chain)
goto out;
}
BUG_ON(!cur_pte_chain->ptes[NRPTE-1]);
for (i = NRPTE-2; i >= 0; i--) {
if (!cur_pte_chain->ptes[i]) {
cur_pte_chain->ptes[i] = pte_paddr;
......@@ -220,7 +218,6 @@ page_add_rmap(struct page *page, pte_t *ptep, struct pte_chain *pte_chain)
BUG();
out:
pte_chain_unlock(page);
inc_page_state(nr_reverse_maps);
return pte_chain;
}
......@@ -251,7 +248,6 @@ void page_remove_rmap(struct page * page, pte_t * ptep)
if (PageDirect(page)) {
if (page->pte.direct == pte_paddr) {
page->pte.direct = 0;
dec_page_state(nr_reverse_maps);
ClearPageDirect(page);
goto out;
}
......@@ -274,7 +270,6 @@ void page_remove_rmap(struct page * page, pte_t * ptep)
if (pa != pte_paddr)
continue;
pc->ptes[i] = start->ptes[victim_i];
dec_page_state(nr_reverse_maps);
start->ptes[victim_i] = 0;
if (victim_i == NRPTE-1) {
/* Emptied a pte_chain */
......@@ -435,7 +430,6 @@ int try_to_unmap(struct page * page)
ret = try_to_unmap_one(page, page->pte.direct);
if (ret == SWAP_SUCCESS) {
page->pte.direct = 0;
dec_page_state(nr_reverse_maps);
ClearPageDirect(page);
}
goto out;
......@@ -466,7 +460,6 @@ int try_to_unmap(struct page * page)
*/
pc->ptes[i] = start->ptes[victim_i];
start->ptes[victim_i] = 0;
dec_page_state(nr_reverse_maps);
victim_i++;
if (victim_i == NRPTE) {
page->pte.chain = start->next;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment