Re: [PATCH v3 5/5] mem-hotplug: Introduce movablenode boot option to control memblock allocation direction.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]