mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: "Martin J. Bligh" <mbligh@mbligh.org>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] add page_state info to show_mem
Date: Wed, 1 Jun 2005 19:09:42 +1000	[thread overview]
Message-ID: <20050601090942.GF9193@krispykreme> (raw)
In-Reply-To: <375690000.1117584499@flay>


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/

      reply	other threads:[~2005-06-01  9:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-01  0:08 Martin J. Bligh
2005-06-01  9:09 ` Anton Blanchard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050601090942.GF9193@krispykreme \
    --to=anton@samba.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@mbligh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®