public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] add page_state info to show_mem
@ 2005-06-01  0:08 Martin J. Bligh
  2005-06-01  9:09 ` Anton Blanchard
  0 siblings, 1 reply; 2+ messages in thread
From: Martin J. Bligh @ 2005-06-01  0:08 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

This helps a lot when debugging out of memory stuff - useful especially
to see if all the memory is sucked into slab, etc.

diff -purN -X /home/mbligh/.diff.exclude 2.6.11/arch/i386/mm/pgtable.c 2.6.11-show_mem_slab/arch/i386/mm/pgtable.c
--- 2.6.11/arch/i386/mm/pgtable.c	2005-03-02 02:59:09.000000000 -0800
+++ 2.6.11-show_mem_slab/arch/i386/mm/pgtable.c	2005-05-31 15:58:36.000000000 -0700
@@ -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);
 }
 
 /*


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] add page_state info to show_mem
  2005-06-01  0:08 [PATCH] add page_state info to show_mem Martin J. Bligh
@ 2005-06-01  9:09 ` Anton Blanchard
  0 siblings, 0 replies; 2+ messages in thread
From: Anton Blanchard @ 2005-06-01  9:09 UTC (permalink / raw)
  To: Martin J. Bligh; +Cc: Andrew Morton, linux-kernel


Hi,

> 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

> diff -purN -X /home/mbligh/.diff.exclude 2.6.11/arch/i386/mm/pgtable.c 2.6.11-show_mem_slab/arch/i386/mm/pgtable.c
> --- 2.6.11/arch/i386/mm/pgtable.c	2005-03-02 02:59:09.000000000 -0800
> +++ 2.6.11-show_mem_slab/arch/i386/mm/pgtable.c	2005-05-31 15:58:36.000000000 -0700
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-06-01  9:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-01  0:08 [PATCH] add page_state info to show_mem Martin J. Bligh
2005-06-01  9:09 ` Anton Blanchard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox