lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5240731B.9070906@gmail.com>
Date:	Tue, 24 Sep 2013 00:58:03 +0800
From:	Zhang Yanfei <zhangyanfei.yes@...il.com>
To:	Tejun Heo <tj@...nel.org>
CC:	Tang Chen <tangchen@...fujitsu.com>, rjw@...k.pl, lenb@...nel.org,
	tglx@...utronix.de, mingo@...e.hu, hpa@...or.com,
	akpm@...ux-foundation.org, toshi.kani@...com,
	zhangyanfei@...fujitsu.com, liwanp@...ux.vnet.ibm.com,
	trenn@...e.de, yinghai@...nel.org, jiang.liu@...wei.com,
	wency@...fujitsu.com, laijs@...fujitsu.com,
	isimatu.yasuaki@...fujitsu.com, izumi.taku@...fujitsu.com,
	mgorman@...e.de, minchan@...nel.org, mina86@...a86.com,
	gong.chen@...ux.intel.com, vasilis.liaskovitis@...fitbricks.com,
	lwoodman@...hat.com, riel@...hat.com, jweiner@...hat.com,
	prarit@...hat.com, x86@...nel.org, linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	linux-acpi@...r.kernel.org
Subject: Re: [PATCH v3 5/5] mem-hotplug: Introduce movablenode boot option
 to control memblock allocation direction.

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@...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

Powered by Openwall GNU/*/Linux Powered by OpenVZ