From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail137.messagelabs.com (mail137.messagelabs.com [216.82.249.19]) by kanga.kvack.org (Postfix) with SMTP id 9D6956B003D for ; Thu, 19 Mar 2009 14:18:24 -0400 (EDT) Received: from localhost (smtp.ultrahosting.com [127.0.0.1]) by smtp.ultrahosting.com (Postfix) with ESMTP id 42CEF82C804 for ; Thu, 19 Mar 2009 14:25:24 -0400 (EDT) Received: from smtp.ultrahosting.com ([74.213.174.254]) by localhost (smtp.ultrahosting.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R0fH1Wa8PLWA for ; Thu, 19 Mar 2009 14:25:18 -0400 (EDT) Received: from qirst.com (unknown [74.213.171.31]) by smtp.ultrahosting.com (Postfix) with ESMTP id 2BEA382C7FA for ; Thu, 19 Mar 2009 14:25:18 -0400 (EDT) Date: Thu, 19 Mar 2009 14:15:32 -0400 (EDT) From: Christoph Lameter Subject: Re: [PATCH 24/27] Convert gfp_zone() to use a table of precalculated values In-Reply-To: <20090319181116.GA24586@csn.ul.ie> Message-ID: References: <20090318135222.GA4629@csn.ul.ie> <20090318153508.GA24462@csn.ul.ie> <20090318181717.GC24462@csn.ul.ie> <20090318194604.GD24462@csn.ul.ie> <20090319090456.fb11e23c.kamezawa.hiroyu@jp.fujitsu.com> <20090319181116.GA24586@csn.ul.ie> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org To: Mel Gorman Cc: KAMEZAWA Hiroyuki , Linux Memory Management List , Pekka Enberg , Rik van Riel , KOSAKI Motohiro , Johannes Weiner , Nick Piggin , Linux Kernel Mailing List , Lin Ming , Zhang Yanmin , Peter Zijlstra List-ID: On Thu, 19 Mar 2009, Mel Gorman wrote: > I ran into exactly that problem and ended up shoving the table into > page_alloc.c but then there is no benefits from having the table statically > declared because there is no constant folding. Right. The table must be defined in the .h file. Just a matter of figuring out how to convince the compiler/linker to do the right thing. > > + if (__builtin_constant_p(zone)) > > + BUILD_BUG_ON(zone == BAD_ZONE); > > +#ifdef CONFIG_DEBUG_VM > > + else > > + BUG_ON(zone == BAD_ZONE); > > #endif > > That could be made a bit prettier with > > if (__builtin_constant_p(zone)) > BUILD_BUG_ON(zone == BAD_ZONE); > VM_BUG_ON(zone == BAD_ZONE); VM_BUG_ON is not available here. It has to be that ugly. -- 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: email@kvack.org