From: Rashmica <rashmicy@gmail.com>
To: Balbir Singh <bsingharora@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/Kconfig: Update config option based on page size.
Date: Fri, 19 Feb 2016 15:31:20 +1100 [thread overview]
Message-ID: <56C69A98.3020800@gmail.com> (raw)
In-Reply-To: <56C69535.90907@gmail.com>
On 19/02/16 15:08, Balbir Singh wrote:
>
> On 19/02/16 12:55, Rashmica Gupta wrote:
>> Currently on PPC64 changing kernel pagesize from 4K to 64K leaves
>> FORCE_MAX_ZONEORDER set to 13 - which produces a compile error.
>>
>> The error occurs because of the following constraint (from
>> include/linux/mmzone.h) being violated:
>>
>> MAX_ORDER -1 + PAGESHIFT <= SECTION_SIZE_BITS.
> IA64 has this cool hack
>
> 12 #ifdef CONFIG_FORCE_MAX_ZONEORDER
> 13 #if ((CONFIG_FORCE_MAX_ZONEORDER - 1 + PAGE_SHIFT) > SECTION_SIZE_BITS)
> 14 #undef SECTION_SIZE_BITS
> 15 #define SECTION_SIZE_BITS (CONFIG_FORCE_MAX_ZONEORDER - 1 + PAGE_SHIFT)
> 16 #endif
>
> But coming back (we can revisit the SECTION_SIZE_BITS definition later)
I feel like someone more senior than me should weigh in on if this is
worth doing...
> MAX_ORDER -1 + 16 <= 24 for 64 K
>
> and
>
> MAX_ORDER -1 + 12 < = 24 for 4K
>
> Your calculations are correct
>> Expanding this out, we get:
>>
>> FORCE_MAX_ZONEBITS <= 25 - PAGESHIFT,
>>
>> which requires, for a 64K page, FORCE_MAX_ZONEBITS <= 9. Thus
>> set max value of FORCE_MAX_ZONEORDER for 64K pages to 9.
>>
>> Also, check the minimum value:
>> In include/linux/huge_mm.h, we have the constraint HPAGE_PMD_ORDER <
>> MAX_ORDER which expands out to:
>>
>> PTE_INDEX_SIZE < FORCE_MAX_ZONEORDER.
>> PTE_INDEX_SIZE is:
>> 9 (4k hash or no hash 4K pgtable) or
>> 8 (64K hash or no hash 64K pgtable).
>> Thus a min value of 9 for 64K pages is reasonable.
> For 4K pages we end up with
>
> 9 < FORCE_MAX_ZONE_ORDER
> FORCE_MAX_ZONE_ORDER -1 + 12 < = 24
>
> The range is 9 to 13
>
> For 64K we end up with
> 8 < FORCE_MAX_ZONE_ORDER
> FORCE_MAX_ZONE_ORDER -1 + 16 <= 24 or FORCE_MAX_ZONE_ORDER <= 9
>
> The range is really between 8 and 9 unless we tweak the SECTION_SIZE_BITS
Yup, you are right! Might have had a brain spaz...
>> So, update the range of FORCE_MAX_ZONEORDER from 9-64 to 9-9.
>>
>> Signed-off-by: Rashmica Gupta <rashmicy@gmail.com>
>> ---
>> arch/powerpc/Kconfig | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>> index e4824fd04bb7..3bd3465b93ba 100644
>> --- a/arch/powerpc/Kconfig
>> +++ b/arch/powerpc/Kconfig
>> @@ -585,7 +585,7 @@ endchoice
>>
>> config FORCE_MAX_ZONEORDER
>> int "Maximum zone order"
>> - range 9 64 if PPC64 && PPC_64K_PAGES
>> + range 9 9 if PPC64 && PPC_64K_PAGES
> range 8 9?
Agreed.
>> default "9" if PPC64 && PPC_64K_PAGES
>> range 13 64 if PPC64 && !PPC_64K_PAGES
> Should this be fixed as well?
> range 9 13?
Agreed.
>> default "13" if PPC64 && !PPC_64K_PAGES
Should the default values remain as is, or follow the trend and be equal
to the minimum value?
> Please check my calculations
>
> Reviewed-by: Balbir Singh <bsingharora@gmail.com>
>
> Balbir Singh
next prev parent reply other threads:[~2016-02-19 4:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-19 1:55 [PATCH] powerpc/Kconfig: Update config option based on page size Rashmica Gupta
2016-02-19 4:08 ` Balbir Singh
2016-02-19 4:31 ` Rashmica [this message]
2016-02-19 8:15 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56C69A98.3020800@gmail.com \
--to=rashmicy@gmail.com \
--cc=bsingharora@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.