* Re: [PATCH] mm: setup pageblock_order before it's used by sparse
[not found] ` <CAE9FiQXpeGFfWvUHHW_GjgTg+4Op7agsht5coZbcmn2W=f9bqw@mail.gmail.com>
@ 2012-07-03 2:54 ` Jiang Liu
2012-07-03 3:25 ` Yinghai Lu
0 siblings, 1 reply; 5+ messages in thread
From: Jiang Liu @ 2012-07-03 2:54 UTC (permalink / raw)
To: Yinghai Lu
Cc: Tony Luck, linux-mm, linux-kernel, stable, Minchan Kim,
Keping Chen, Mel Gorman, KOSAKI Motohiro, David Rientjes,
Xishi Qiu, Andrew Morton, David Gibson, linuxppc-dev,
KAMEZAWA Hiroyuki, Jiang Liu
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.
So it would be better to keep function set_pageblock_order(), it will
fix the memory wasting on both IA64 and PowerPC.
Thanks!
Gerry
>
> Thanks
>
> Yinghai
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm: setup pageblock_order before it's used by sparse
2012-07-03 2:54 ` [PATCH] mm: setup pageblock_order before it's used by sparse Jiang Liu
@ 2012-07-03 3:25 ` Yinghai Lu
2012-07-03 3:29 ` Jiang Liu
2012-07-18 7:15 ` Benjamin Herrenschmidt
0 siblings, 2 replies; 5+ messages in thread
From: Yinghai Lu @ 2012-07-03 3:25 UTC (permalink / raw)
To: Jiang Liu, Benjamin Herrenschmidt
Cc: Tony Luck, linux-mm, linux-kernel, stable, Minchan Kim,
Keping Chen, Mel Gorman, KOSAKI Motohiro, David Rientjes,
Xishi Qiu, Andrew Morton, David Gibson, linuxppc-dev,
KAMEZAWA Hiroyuki, Jiang Liu
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 =91,=92 or =91;=92 before =91__att=
ribute__=92
>>>
>>> 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 earlyp=
aram.
>>
>> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm: setup pageblock_order before it's used by sparse
2012-07-03 3:25 ` Yinghai Lu
@ 2012-07-03 3:29 ` Jiang Liu
2012-07-18 7:17 ` Benjamin Herrenschmidt
2012-07-18 7:15 ` Benjamin Herrenschmidt
1 sibling, 1 reply; 5+ messages in thread
From: Jiang Liu @ 2012-07-03 3:29 UTC (permalink / raw)
To: Yinghai Lu
Cc: Tony Luck, linux-mm, linux-kernel, stable, Minchan Kim,
Keping Chen, Mel Gorman, KOSAKI Motohiro, David Rientjes,
Xishi Qiu, Andrew Morton, David Gibson, linuxppc-dev,
KAMEZAWA Hiroyuki, Jiang Liu
>> 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.
OK, waiting response from PPC. If we could find some ways to set HPAGE_SIZE
early on PPC too, we can setup pageblock_order in arch instead of page_alloc.c
as early as possible.
Thanks!
Gerry
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm: setup pageblock_order before it's used by sparse
2012-07-03 3:25 ` Yinghai Lu
2012-07-03 3:29 ` Jiang Liu
@ 2012-07-18 7:15 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2012-07-18 7:15 UTC (permalink / raw)
To: Yinghai Lu
Cc: Tony Luck, Jiang Liu, linux-mm, linux-kernel, stable, Minchan Kim,
Keping Chen, Mel Gorman, KOSAKI Motohiro, David Rientjes,
Xishi Qiu, Andrew Morton, David Gibson, linuxppc-dev,
KAMEZAWA Hiroyuki, Jiang Liu
On Mon, 2012-07-02 at 20:25 -0700, Yinghai Lu wrote:
> > 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.
Hrm, HPAGE_SHIFT is initially 0 because we only know at runtime what
huge page sizes are going to be supported (if any).
The business with pageblock_order is new to me and does look bogus today
indeed. But not a huge deal either. Our MAX_ORDER is typically 9 (64K
pages) or 13 (4K pages) and our standard huge page size is generally 16M
so there isn't a big difference here.
Still, maybe something worth looking into...
Cheers,
Ben.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm: setup pageblock_order before it's used by sparse
2012-07-03 3:29 ` Jiang Liu
@ 2012-07-18 7:17 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2012-07-18 7:17 UTC (permalink / raw)
To: Jiang Liu
Cc: Tony Luck, linux-mm, linuxppc-dev, linux-kernel, stable,
Minchan Kim, Keping Chen, Mel Gorman, KOSAKI Motohiro,
David Rientjes, Xishi Qiu, Andrew Morton, David Gibson,
Yinghai Lu, KAMEZAWA Hiroyuki, Jiang Liu
On Tue, 2012-07-03 at 11:29 +0800, Jiang Liu wrote:
> OK, waiting response from PPC. If we could find some ways to set
> HPAGE_SIZE
> early on PPC too, we can setup pageblock_order in arch instead of
> page_alloc.c
> as early as possible.
We could split our hugetlbpage_init() into two, with the bit that sets
HPAGE_SHIFT called earlier if it's really an issue.
Cheers,
Ben.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-07-18 7:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1341047274-5616-1-git-send-email-jiang.liu@huawei.com>
[not found] ` <CAE9FiQWzfLkeQs8O22MUEmuGUx=jPi5s=wZt2fcpFMcwrzt3uA@mail.gmail.com>
[not found] ` <4FF100F0.9050501@huawei.com>
[not found] ` <CAE9FiQXpeGFfWvUHHW_GjgTg+4Op7agsht5coZbcmn2W=f9bqw@mail.gmail.com>
2012-07-03 2:54 ` [PATCH] mm: setup pageblock_order before it's used by sparse Jiang Liu
2012-07-03 3:25 ` Yinghai Lu
2012-07-03 3:29 ` Jiang Liu
2012-07-18 7:17 ` Benjamin Herrenschmidt
2012-07-18 7:15 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).