Re: [PATCH] add page_state info to show_mem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
-
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/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux