From mboxrd@z Thu Jan 1 00:00:00 1970 From: "KAMEZAWA Hiroyuki" Subject: Re: [patch] nodemask: make NODEMASK_ALLOC more general Date: Sat, 3 Oct 2009 10:03:30 +0900 (JST) Message-ID: References: <20091001165721.32248.14861.sendpatchset@localhost.localdomain> <20091001165832.32248.32725.sendpatchset@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: Sender: linux-numa-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Christoph Lameter Cc: David Rientjes , Andrew Morton , linux-mm@kvack.org, linux-numa@vger.kernel.org, Mel Gorman , Randy Dunlap , Nishanth Aravamudan , Adam Litke , Andy Whitcroft , eric.whitney@hp.com, Lee Schermerhorn , KAMEZAWA Hiroyuki Christoph Lameter wrote: > On Fri, 2 Oct 2009, David Rientjes wrote: > >> NODEMASK_ALLOC(x, m) assumes x is a type of struct, which is >> unnecessary. >> It's perfectly reasonable to use this macro to allocate a nodemask_t, >> which is anonymous, either dynamically or on the stack depending on >> NODES_SHIFT. > > There is currently only one user of NODEMASK_ALLOC which is > NODEMASK_SCRATCH. > yes. > Can we generalize the functionality here? The macro is basically choosing > between a slab allocation or a stack allocation depending on the > configured system size. > > NUMA_COND__ALLOC(, , > ) > > or so? > sounds reasonable. It seems cpumask has ifdef CONFIG_CPUMASK_OFFSTACK > Its likely that one way want to allocate other structures on the stack > that may get too big if large systems need to be supported. > maybe using the same style as cpumask will be reasonable. Thanks, -Kame