[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.10.0903191817250.31984@qirst.com>
Date: Thu, 19 Mar 2009 18:22:38 -0400 (EDT)
From: Christoph Lameter <cl@...ux-foundation.org>
To: Mel Gorman <mel@....ul.ie>
cc: Linux Memory Management List <linux-mm@...ck.org>,
Pekka Enberg <penberg@...helsinki.fi>,
Rik van Riel <riel@...hat.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Johannes Weiner <hannes@...xchg.org>,
Nick Piggin <npiggin@...e.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Lin Ming <ming.m.lin@...el.com>,
Zhang Yanmin <yanmin_zhang@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 20/35] Use a pre-calculated value for
num_online_nodes()
On Thu, 19 Mar 2009, Mel Gorman wrote:
> This patch actually alters the API. node_set_online() called when
> MAX_NUMNODES == 1 will now fail to compile. That situation wouldn't make
> any sense anyway but is it intentional?
Yes MAX_NUMNODES means that this is not a NUMA configuration. Setting an
ode online would make no sense. Node 0 is always online.
> For reference here is the patch I had for a similar goal which kept the
> API as it was. I'll drop it if you prefer your own version.
Lets look through it and get the best pieces from both.
> static inline void node_set_state(int node, enum node_states state)
> {
> __node_set(node, &node_states[state]);
> + if (state == N_ONLINE)
> + nr_online_nodes = num_node_state(N_ONLINE);
> }
That assumes uses of node_set_state N_ONLINE. Are there such users or are
all using node_set_online()?
> @@ -449,7 +457,8 @@ static inline int num_node_state(enum node_states state)
> node; \
> })
>
> -#define num_online_nodes() num_node_state(N_ONLINE)
> +
> +#define num_online_nodes() (nr_online_nodes)
> #define num_possible_nodes() num_node_state(N_POSSIBLE)
> #define node_online(node) node_state((node), N_ONLINE)
> #define node_possible(node) node_state((node), N_POSSIBLE)
Hmmmm... Yes we could get rid of those.
I'd also like to see nr_possible_nodes(). nr_possible_nodes is important
if you want to check if the system could ever bring up a second node
(which would make the current optimization not viable) whereas
nr_online_nodes is the check for how many nodes are currently online.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists