lkml.org 
[lkml]   [2012]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] mm: setup pageblock_order before it's used by sparse
From
On Mon, Jul 2, 2012 at 7:54 PM, Jiang Liu <jiang.liu@huawei.com> wrote:
> On 2012-7-3 4:43, Yinghai Lu wrote:
>> On Sun, Jul 1, 2012 at 7:01 PM, Jiang Liu <jiang.liu@huawei.com> wrote:
>>> Hi Yinghai,
>>> The patch fails compilation as below:
>>> mm/page_alloc.c:151: error: initializer element is not constant
>>> mm/page_alloc.c:151: error: expected ‘,’ or ‘;’ before ‘__attribute__’
>>>
>>> On IA64, HUGETLB_PAGE_ORDER has dependency on variable hpage_shift.
>>> # define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
>>> # define HPAGE_SHIFT hpage_shift
>>>
>>> And hpage_shift could be changed by early parameter "hugepagesz".
>>> So seems will still need to keep function set_pageblock_order().
>>
>> ah, then use use _DEFAULT instead and later could update that in earlyparam.
>>
>> So attached -v2 should work.
> Hi Yinghai,
>
> I'm afraid the v2 will break powerpc. Currently only IA64 and PowerPC
> supports variable hugetlb size.
>
> HPAGE_SHIFT is a variable default to 0 on powerpc. But seems PowerPC
> is doing something wrong here, according to it's mm initialization
> sequence as below:
> start_kernel()
> setup_arch()
> paging_init()
> free_area_init_node()
> set_pageblock_order()
> refer to HPAGE_SHIFT (still 0)
> init_rest()
> do_initcalls()
> hugetlbpage_init()
> setup HPAGE_SHIFT
> That means pageblock_order is always set to "MAX_ORDER - 1", not sure
> whether this is intended. And it has the same issue as IA64 of wasting
> memory if CONFIG_SPARSE is enabled.

adding BenH, need to know if it is powerpc intended.

>
> So it would be better to keep function set_pageblock_order(), it will
> fix the memory wasting on both IA64 and PowerPC.

Should setup pageblock_order as early as possible to avoid confusing.

Thanks

Yinghai
--
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/

\
 
 \ /
  Last update: 2012-07-03 06:01    [W:0.107 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site