add page_state info to show_mem
PATCH 1/1 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.
arch/i386/mm/pgtable.c +8 -0
@@ -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 ("%d pages dirty\n" , ps.nr_dirty); +printk ("%d pages writeback\n" , ps.nr_writeback); +printk ("%d pages mapped\n" , ps.nr_mapped); +printk ("%d pages slab\n" , ps.nr_slab); +printk ("%d pages pagetables\n" , ps.nr_page_table_pages); }/*
Hi,
Quoted 2 lines
This helps a lot when debugging out of memory stuff - useful especially to see if all the memory is sucked into slab, etc.
I was going to add this to ppc64 but I noticed that except for HIGHMEM bits it all looks the same :) Perhaps show_mem should end up somewhere common.
Anton
Quoted 31 lines
diff -purN -X
/home/mbligh/.diff.exclude2.6.11/arch/i386/mm/pgtable.c2.6.11-show_mem_slab/arch/i386/mm/pgtable.carch/i386/mm/pgtable.c +8
-1@@ -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 ("%d pages dirty\n" , ps.nr_dirty); +printk ("%d pages writeback\n" , ps.nr_writeback); +printk ("%d pages mapped\n" , ps.nr_mapped); +printk ("%d pages slab\n" , ps.nr_slab); +printk ("%d pages pagetables\n" , ps.nr_page_table_pages); }/* -To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/