From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Christoph Lameter <clameter@sgi.com>
Cc: linux-kernel@vger.kernel.org, Hugh Dickins <hugh@veritas.com>,
linux-mm@kvack.org, Andi Kleen <ak@suse.de>,
Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Subject: Re: [RFC 2/3] Make nr_mapped a per node counter
Date: Wed, 07 Dec 2005 10:05:45 +1100 [thread overview]
Message-ID: <43961949.8070900@yahoo.com.au> (raw)
In-Reply-To: <20051206182848.19188.12787.sendpatchset@schroedinger.engr.sgi.com>
Christoph Lameter wrote:
> Make nr_mapped a per node counter
>
> The per cpu nr_mapped counter is important because it allows a determination
> how many pages of a node are not mapped, which would allow a more effiecient
> means of determining when a node should reclaim memory.
>
> Signed-off-by: Christoph Lameter <clameter@sgi.com>
>
> Index: linux-2.6.15-rc3/include/linux/page-flags.h
> ===================================================================
> --- linux-2.6.15-rc3.orig/include/linux/page-flags.h 2005-12-01 00:35:38.000000000 -0800
> +++ linux-2.6.15-rc3/include/linux/page-flags.h 2005-12-01 00:35:49.000000000 -0800
> @@ -85,7 +85,6 @@ struct page_state {
> unsigned long nr_writeback; /* Pages under writeback */
> unsigned long nr_unstable; /* NFS unstable pages */
> unsigned long nr_page_table_pages;/* Pages used for pagetables */
> - unsigned long nr_mapped; /* mapped into pagetables */
> unsigned long nr_slab; /* In slab */
> #define GET_PAGE_STATE_LAST nr_slab
>
> @@ -165,8 +164,8 @@ extern void __mod_page_state(unsigned lo
> /*
> * Node based accounting with per cpu differentials.
> */
> -enum node_stat_item { };
> -#define NR_STAT_ITEMS 0
> +enum node_stat_item { NR_MAPPED };
> +#define NR_STAT_ITEMS 1
>
> extern unsigned long vm_stat_global[NR_STAT_ITEMS];
> extern unsigned long vm_stat_node[MAX_NUMNODES][NR_STAT_ITEMS];
> Index: linux-2.6.15-rc3/drivers/base/node.c
> ===================================================================
> --- linux-2.6.15-rc3.orig/drivers/base/node.c 2005-11-28 19:51:27.000000000 -0800
> +++ linux-2.6.15-rc3/drivers/base/node.c 2005-12-01 00:35:49.000000000 -0800
> @@ -53,8 +53,6 @@ static ssize_t node_read_meminfo(struct
> ps.nr_dirty = 0;
> if ((long)ps.nr_writeback < 0)
> ps.nr_writeback = 0;
> - if ((long)ps.nr_mapped < 0)
> - ps.nr_mapped = 0;
> if ((long)ps.nr_slab < 0)
> ps.nr_slab = 0;
>
> @@ -83,7 +81,7 @@ static ssize_t node_read_meminfo(struct
> nid, K(i.freeram - i.freehigh),
> nid, K(ps.nr_dirty),
> nid, K(ps.nr_writeback),
> - nid, K(ps.nr_mapped),
> + nid, K(vm_stat_node[nid][NR_MAPPED]),
> nid, K(ps.nr_slab));
> n += hugetlb_report_node_meminfo(nid, buf + n);
> return n;
> Index: linux-2.6.15-rc3/fs/proc/proc_misc.c
> ===================================================================
> --- linux-2.6.15-rc3.orig/fs/proc/proc_misc.c 2005-11-28 19:51:27.000000000 -0800
> +++ linux-2.6.15-rc3/fs/proc/proc_misc.c 2005-12-01 00:35:49.000000000 -0800
> @@ -190,7 +190,7 @@ static int meminfo_read_proc(char *page,
> K(i.freeswap),
> K(ps.nr_dirty),
> K(ps.nr_writeback),
> - K(ps.nr_mapped),
> + K(vm_stat_global[NR_MAPPED]),
> K(ps.nr_slab),
> K(allowed),
> K(committed),
> Index: linux-2.6.15-rc3/mm/vmscan.c
> ===================================================================
> --- linux-2.6.15-rc3.orig/mm/vmscan.c 2005-11-28 19:51:27.000000000 -0800
> +++ linux-2.6.15-rc3/mm/vmscan.c 2005-12-01 00:35:49.000000000 -0800
> @@ -967,7 +967,7 @@ int try_to_free_pages(struct zone **zone
> }
>
> for (priority = DEF_PRIORITY; priority >= 0; priority--) {
> - sc.nr_mapped = read_page_state(nr_mapped);
> + sc.nr_mapped = vm_stat_global[NR_MAPPED];
> sc.nr_scanned = 0;
> sc.nr_reclaimed = 0;
> sc.priority = priority;
> @@ -1056,7 +1056,7 @@ loop_again:
> sc.gfp_mask = GFP_KERNEL;
> sc.may_writepage = 0;
> sc.may_swap = 1;
> - sc.nr_mapped = read_page_state(nr_mapped);
> + sc.nr_mapped = vm_stat_global[NR_MAPPED];
>
Any chance you can wrap these in macros? (something like read_page_node_state())
I gather Andrew did this so that they can easily be defined out for things
that don't want them (maybe, embedded systems).
--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2005-12-06 23:05 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-06 18:28 [RFC 1/3] Framework for accurate node based statistics Christoph Lameter
2005-12-06 18:28 ` [RFC 2/3] Make nr_mapped a per node counter Christoph Lameter
2005-12-06 23:05 ` Nick Piggin [this message]
2005-12-06 18:28 ` [RFC 3/3] Make nr_pagecache " Christoph Lameter
2005-12-06 18:35 ` [RFC 1/3] Framework for accurate node based statistics Andi Kleen
2005-12-06 19:08 ` Christoph Lameter
2005-12-06 19:26 ` Andi Kleen
2005-12-06 19:36 ` Christoph Lameter
2005-12-06 20:06 ` Andi Kleen
2005-12-06 22:52 ` Christoph Lameter
2005-12-07 5:50 ` Keith Owens
2005-12-07 18:24 ` Christoph Lameter
2005-12-06 23:08 ` Nick Piggin
2005-12-06 23:37 ` Christoph Lameter
2005-12-06 23:40 ` Christoph Lameter
2005-12-07 6:44 ` Nick Piggin
2005-12-07 18:27 ` Christoph Lameter
2005-12-07 22:59 ` Nick Piggin
2005-12-08 0:02 ` Christoph Lameter
2005-12-08 0:13 ` Nick Piggin
2005-12-08 0:35 ` Christoph Lameter
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=43961949.8070900@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=ak@suse.de \
--cc=clameter@sgi.com \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=marcelo.tosatti@cyclades.com \
/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