提交 6f4e1e50 编写于 作者: M Martin J. Bligh 提交者: Linus Torvalds

[PATCH] add page_state info to show_mem

This helps a lot when debugging out of memory stuff - useful especially to
see if all the memory is sucked into slab, etc.
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 bbfceef4
......@@ -30,6 +30,7 @@ void show_mem(void)
struct page *page;
pg_data_t *pgdat;
unsigned long i;
struct page_state ps;
printk("Mem-info:\n");
show_free_areas();
......@@ -53,6 +54,13 @@ void show_mem(void)
printk("%d reserved pages\n",reserved);
printk("%d pages shared\n",shared);
printk("%d pages swap cached\n",cached);
get_page_state(&ps);
printk("%lu pages dirty\n", ps.nr_dirty);
printk("%lu pages writeback\n", ps.nr_writeback);
printk("%lu pages mapped\n", ps.nr_mapped);
printk("%lu pages slab\n", ps.nr_slab);
printk("%lu pages pagetables\n", ps.nr_page_table_pages);
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册