LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: akpm@osdl.org
Cc: Paul Menage <menage@google.com>,
linux-kernel@vger.kernel.org,
Nick Piggin <nickpiggin@yahoo.com.au>,
linux-mm@kvack.org, Andi Kleen <ak@suse.de>,
Paul Jackson <pj@sgi.com>, Dave Chinner <dgc@sgi.com>,
Christoph Lameter <clameter@sgi.com>
Subject: [RFC 1/8] Convert higest_possible_node_id() into nr_node_ids
Date: Mon, 15 Jan 2007 21:47:48 -0800 (PST) [thread overview]
Message-ID: <20070116054748.15358.31856.sendpatchset@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20070116054743.15358.77287.sendpatchset@schroedinger.engr.sgi.com>
Replace highest_possible_node_id() with nr_node_ids
highest_possible_node_id() is used to calculate the last possible node id
so that the network subsystem can figure out how to size per node arrays.
I think having the ability to determine the maximum amount of nodes in
a system at runtime is useful but then we should name this entry
correspondingly and also only calculate the value once on bootup.
This patch introduces nr_node_ids and replaces the use of
highest_possible_node_id(). nr_node_ids is calculated on bootup when
the page allocators pagesets are initialized.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Index: linux-2.6.20-rc4-mm1/include/linux/nodemask.h
===================================================================
--- linux-2.6.20-rc4-mm1.orig/include/linux/nodemask.h 2007-01-06 21:45:51.000000000 -0800
+++ linux-2.6.20-rc4-mm1/include/linux/nodemask.h 2007-01-12 12:59:50.000000000 -0800
@@ -352,7 +352,7 @@
#define node_possible(node) node_isset((node), node_possible_map)
#define first_online_node first_node(node_online_map)
#define next_online_node(nid) next_node((nid), node_online_map)
-int highest_possible_node_id(void);
+extern int nr_node_ids;
#else
#define num_online_nodes() 1
#define num_possible_nodes() 1
@@ -360,7 +360,7 @@
#define node_possible(node) ((node) == 0)
#define first_online_node 0
#define next_online_node(nid) (MAX_NUMNODES)
-#define highest_possible_node_id() 0
+#define nr_node_ids 1
#endif
#define any_online_node(mask) \
Index: linux-2.6.20-rc4-mm1/mm/page_alloc.c
===================================================================
--- linux-2.6.20-rc4-mm1.orig/mm/page_alloc.c 2007-01-12 12:58:26.000000000 -0800
+++ linux-2.6.20-rc4-mm1/mm/page_alloc.c 2007-01-12 12:59:50.000000000 -0800
@@ -679,6 +679,26 @@
return i;
}
+#if MAX_NUMNODES > 1
+int nr_node_ids __read_mostly;
+EXPORT_SYMBOL(nr_node_ids);
+
+/*
+ * Figure out the number of possible node ids.
+ */
+static void __init setup_nr_node_ids(void)
+{
+ unsigned int node;
+ unsigned int highest = 0;
+
+ for_each_node_mask(node, node_possible_map)
+ highest = node;
+ nr_node_ids = highest + 1;
+}
+#else
+static void __init setup_nr_node_ids(void) {}
+#endif
+
#ifdef CONFIG_NUMA
/*
* Called from the slab reaper to drain pagesets on a particular node that
@@ -3318,6 +3338,7 @@
min_free_kbytes = 65536;
setup_per_zone_pages_min();
setup_per_zone_lowmem_reserve();
+ setup_nr_node_ids();
return 0;
}
module_init(init_per_zone_pages_min)
@@ -3519,18 +3540,4 @@
EXPORT_SYMBOL(page_to_pfn);
#endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */
-#if MAX_NUMNODES > 1
-/*
- * Find the highest possible node id.
- */
-int highest_possible_node_id(void)
-{
- unsigned int node;
- unsigned int highest = 0;
- for_each_node_mask(node, node_possible_map)
- highest = node;
- return highest;
-}
-EXPORT_SYMBOL(highest_possible_node_id);
-#endif
Index: linux-2.6.20-rc4-mm1/net/sunrpc/svc.c
===================================================================
--- linux-2.6.20-rc4-mm1.orig/net/sunrpc/svc.c 2007-01-06 21:45:51.000000000 -0800
+++ linux-2.6.20-rc4-mm1/net/sunrpc/svc.c 2007-01-12 12:59:50.000000000 -0800
@@ -116,7 +116,7 @@
static int
svc_pool_map_init_percpu(struct svc_pool_map *m)
{
- unsigned int maxpools = highest_possible_processor_id()+1;
+ unsigned int maxpools = nr_node_ids;
unsigned int pidx = 0;
unsigned int cpu;
int err;
@@ -144,7 +144,7 @@
static int
svc_pool_map_init_pernode(struct svc_pool_map *m)
{
- unsigned int maxpools = highest_possible_node_id()+1;
+ unsigned int maxpools = nr_node_ids;
unsigned int pidx = 0;
unsigned int node;
int err;
next prev parent reply other threads:[~2007-01-16 5:47 UTC|newest]
Thread overview: 110+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-16 5:47 [RFC 0/8] Cpuset aware writeback Christoph Lameter
2007-01-16 5:47 ` Christoph Lameter [this message]
2007-01-16 22:05 ` [RFC 1/8] Convert higest_possible_node_id() into nr_node_ids Andi Kleen
2007-01-17 3:14 ` Christoph Lameter
2007-01-17 4:15 ` Andi Kleen
2007-01-17 4:23 ` Christoph Lameter
2007-01-16 5:47 ` [RFC 2/8] Add a map to inodes to track dirty pages per node Christoph Lameter
2007-01-16 5:47 ` [RFC 3/8] Add a nodemask to pdflush functions Christoph Lameter
2007-01-16 5:48 ` [RFC 4/8] Per cpuset dirty ratio handling and writeout Christoph Lameter
2007-01-16 5:48 ` [RFC 5/8] Make writeout during reclaim cpuset aware Christoph Lameter
2007-01-16 22:07 ` Andi Kleen
2007-01-17 4:20 ` Paul Jackson
2007-01-17 4:28 ` Andi Kleen
2007-01-17 4:36 ` Paul Jackson
2007-01-17 5:59 ` Andi Kleen
2007-01-17 6:19 ` Christoph Lameter
2007-01-17 4:23 ` Christoph Lameter
2007-01-16 5:48 ` [RFC 6/8] Throttle vm writeout per cpuset Christoph Lameter
2007-01-16 5:48 ` [RFC 7/8] Exclude unreclaimable pages from dirty ration calculation Christoph Lameter
2007-01-18 15:48 ` Nikita Danilov
2007-01-18 19:56 ` Christoph Lameter
2007-01-16 5:48 ` [RFC 8/8] Reduce inode memory usage for systems with a high MAX_NUMNODES Christoph Lameter
2007-01-16 19:52 ` Paul Menage
2007-01-16 20:00 ` Christoph Lameter
2007-01-16 20:06 ` Paul Menage
2007-01-16 20:51 ` Christoph Lameter
2007-01-16 7:38 ` [RFC 0/8] Cpuset aware writeback Peter Zijlstra
2007-01-16 20:10 ` Christoph Lameter
2007-01-16 9:25 ` Paul Jackson
2007-01-16 17:13 ` Christoph Lameter
2007-01-16 21:53 ` Andrew Morton
2007-01-16 22:08 ` [PATCH] nfs: fix congestion control Peter Zijlstra
2007-01-16 22:27 ` Trond Myklebust
2007-01-17 2:41 ` Peter Zijlstra
2007-01-17 6:15 ` Trond Myklebust
2007-01-17 8:49 ` Peter Zijlstra
2007-01-17 13:50 ` Trond Myklebust
2007-01-17 14:29 ` Peter Zijlstra
2007-01-17 14:45 ` Trond Myklebust
2007-01-17 20:05 ` Christoph Lameter
2007-01-17 21:52 ` Peter Zijlstra
2007-01-17 21:54 ` Trond Myklebust
2007-01-18 13:27 ` Peter Zijlstra
2007-01-18 15:49 ` Trond Myklebust
2007-01-19 9:33 ` Peter Zijlstra
2007-01-19 13:07 ` Peter Zijlstra
2007-01-19 16:51 ` Trond Myklebust
2007-01-19 17:54 ` Peter Zijlstra
2007-01-19 17:20 ` Christoph Lameter
2007-01-19 17:57 ` Peter Zijlstra
2007-01-19 18:02 ` Christoph Lameter
2007-01-19 18:26 ` Trond Myklebust
2007-01-19 18:27 ` Christoph Lameter
2007-01-20 7:01 ` [PATCH] nfs: fix congestion control -v3 Peter Zijlstra
2007-01-22 16:12 ` Trond Myklebust
2007-01-25 15:32 ` [PATCH] nfs: fix congestion control -v4 Peter Zijlstra
2007-01-26 5:02 ` Andrew Morton
2007-01-26 8:00 ` Peter Zijlstra
2007-01-26 8:50 ` Peter Zijlstra
2007-01-26 5:09 ` Andrew Morton
2007-01-26 5:31 ` Christoph Lameter
2007-01-26 6:04 ` Andrew Morton
2007-01-26 6:53 ` Christoph Lameter
2007-01-26 8:03 ` Peter Zijlstra
2007-01-26 8:51 ` Andrew Morton
2007-01-26 9:01 ` Peter Zijlstra
2007-02-20 12:59 ` Peter Zijlstra
2007-01-22 17:59 ` [PATCH] nfs: fix congestion control -v3 Christoph Lameter
2007-01-17 23:15 ` [PATCH] nfs: fix congestion control Christoph Hellwig
2007-01-16 22:15 ` [RFC 0/8] Cpuset aware writeback Christoph Lameter
2007-01-16 23:40 ` Andrew Morton
2007-01-17 0:16 ` Christoph Lameter
2007-01-17 1:07 ` Andrew Morton
2007-01-17 1:30 ` Christoph Lameter
2007-01-17 2:34 ` Andrew Morton
2007-01-17 3:40 ` Christoph Lameter
2007-01-17 4:02 ` Paul Jackson
2007-01-17 4:05 ` Andrew Morton
2007-01-17 6:27 ` Christoph Lameter
2007-01-17 7:00 ` Andrew Morton
2007-01-17 8:01 ` Paul Jackson
2007-01-17 9:57 ` Andrew Morton
2007-01-17 19:43 ` Christoph Lameter
2007-01-17 22:10 ` Andrew Morton
2007-01-18 1:10 ` Christoph Lameter
2007-01-18 1:25 ` Andrew Morton
2007-01-18 5:21 ` Christoph Lameter
2007-01-16 23:44 ` David Chinner
2007-01-16 22:01 ` Andi Kleen
2007-01-16 22:18 ` Christoph Lameter
2007-02-02 1:38 ` Ethan Solomita
2007-02-02 2:16 ` Christoph Lameter
2007-02-02 4:03 ` Andrew Morton
2007-02-02 5:29 ` Christoph Lameter
2007-02-02 6:02 ` Neil Brown
2007-02-02 6:17 ` Christoph Lameter
2007-02-02 6:41 ` Neil Brown
2007-02-02 7:12 ` Andrew Morton
2007-03-21 21:11 ` Ethan Solomita
2007-03-21 21:29 ` Christoph Lameter
2007-03-21 21:52 ` Andrew Morton
2007-03-21 21:57 ` Christoph Lameter
2007-04-19 2:07 ` Ethan Solomita
2007-04-19 2:55 ` Christoph Lameter
2007-04-19 7:52 ` Ethan Solomita
2007-04-19 16:03 ` Christoph Lameter
2007-04-21 1:37 ` Ethan Solomita
2007-04-21 1:48 ` Christoph Lameter
2007-04-21 8:15 ` Ethan Solomita
2007-04-21 15:40 ` 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=20070116054748.15358.31856.sendpatchset@schroedinger.engr.sgi.com \
--to=clameter@sgi.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=dgc@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=menage@google.com \
--cc=nickpiggin@yahoo.com.au \
--cc=pj@sgi.com \
--subject='Re: [RFC 1/8] Convert higest_possible_node_id() into nr_node_ids' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).