Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753188Ab3IWQ63 (ORCPT ); Mon, 23 Sep 2013 12:58:29 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:62654 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751555Ab3IWQ60 (ORCPT ); Mon, 23 Sep 2013 12:58:26 -0400 Message-ID: <5240731B.9070906@gmail.com> Date: Tue, 24 Sep 2013 00:58:03 +0800 From: Zhang Yanfei User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20120607 Thunderbird/10.0.5 MIME-Version: 1.0 To: Tejun Heo CC: Tang Chen , rjw@sisk.pl, lenb@kernel.org, tglx@linutronix.de, mingo@elte.hu, hpa@zytor.com, akpm@linux-foundation.org, toshi.kani@hp.com, zhangyanfei@cn.fujitsu.com, liwanp@linux.vnet.ibm.com, trenn@suse.de, yinghai@kernel.org, jiang.liu@huawei.com, wency@cn.fujitsu.com, laijs@cn.fujitsu.com, isimatu.yasuaki@jp.fujitsu.com, izumi.taku@jp.fujitsu.com, mgorman@suse.de, minchan@kernel.org, mina86@mina86.com, gong.chen@linux.intel.com, vasilis.liaskovitis@profitbricks.com, lwoodman@redhat.com, riel@redhat.com, jweiner@redhat.com, prarit@redhat.com, x86@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH v3 5/5] mem-hotplug: Introduce movablenode boot option to control memblock allocation direction. References: <1379064655-20874-1-git-send-email-tangchen@cn.fujitsu.com> <1379064655-20874-6-git-send-email-tangchen@cn.fujitsu.com> <20130923155713.GF14547@htj.dyndns.org> In-Reply-To: <20130923155713.GF14547@htj.dyndns.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1429 Lines: 63 Hello tejun, On 09/23/2013 11:57 PM, Tejun Heo wrote: > Hello, > > On Fri, Sep 13, 2013 at 05:30:55PM +0800, Tang Chen wrote: >> +#ifdef CONFIG_MOVABLE_NODE >> + if (movablenode_enable_srat) { >> + /* >> + * When ACPI SRAT is parsed, which is done in initmem_init(), >> + * set memblock back to the default behavior. >> + */ >> + memblock_set_current_direction(MEMBLOCK_DIRECTION_DEFAULT); >> + } >> +#endif /* CONFIG_MOVABLE_NODE */ > > It's kinda weird to have ifdef around the above when all the actual > code would be compiled and linked regardless of the above ifdef. > Wouldn't it make more sense to conditionalize > memblock_direction_bottom_up() so that it's constant false to allow > the compiler to drop unnecessary code? you mean we define memblock_set_bottom_up and memblock_bottom_up like below: #ifdef CONFIG_MOVABLE_NODE void memblock_set_bottom_up(bool enable) { /* do something */ } bool memblock_bottom_up() { return direction == bottom_up; } #else void memblock_set_bottom_up(bool enable) { /* empty */ } bool memblock_bottom_up() { return false; } #endif right? thanks. > > Thanks. > -- Thanks. Zhang Yanfei -- 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/