Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752740AbZDVXFK (ORCPT ); Wed, 22 Apr 2009 19:05:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751450AbZDVXE5 (ORCPT ); Wed, 22 Apr 2009 19:04:57 -0400 Received: from smtp-out.google.com ([216.239.33.17]:50679 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750755AbZDVXE4 (ORCPT ); Wed, 22 Apr 2009 19:04:56 -0400 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id: references:user-agent:mime-version:content-type:x-system-of-record; b=M09qhDqOulMQCdE9anMkkap8RfLXoG+vrtgMc7azpIU1qKhhPfPQXSYiAoR9clwCO dccy7PgHfZI+GuzaaTi+g== Date: Wed, 22 Apr 2009 16:04:47 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Mel Gorman cc: Linux Memory Management List , KOSAKI Motohiro , Christoph Lameter , Nick Piggin , Linux Kernel Mailing List , Lin Ming , Zhang Yanmin , Peter Zijlstra , Pekka Enberg , Andrew Morton Subject: Re: [PATCH 21/22] Use a pre-calculated value instead of num_online_nodes() in fast paths In-Reply-To: <1240408407-21848-22-git-send-email-mel@csn.ul.ie> Message-ID: References: <1240408407-21848-1-git-send-email-mel@csn.ul.ie> <1240408407-21848-22-git-send-email-mel@csn.ul.ie> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1161 Lines: 34 On Wed, 22 Apr 2009, Mel Gorman wrote: > diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h > index 848025c..474e73e 100644 > --- a/include/linux/nodemask.h > +++ b/include/linux/nodemask.h > @@ -408,6 +408,19 @@ static inline int num_node_state(enum node_states state) > #define next_online_node(nid) next_node((nid), node_states[N_ONLINE]) > > extern int nr_node_ids; > +extern int nr_online_nodes; > + > +static inline void node_set_online(int nid) > +{ > + node_set_state(nid, N_ONLINE); > + nr_online_nodes = num_node_state(N_ONLINE); > +} > + > +static inline void node_set_offline(int nid) > +{ > + node_clear_state(nid, N_ONLINE); > + nr_online_nodes = num_node_state(N_ONLINE); > +} > #else > > static inline int node_state(int node, enum node_states state) The later #define's of node_set_online() and node_set_offline() in include/linux/nodemask.h should probably be removed now. -- 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/