powerpc/Kconfig: Update config option based on page size.
PATCH 1/1 powerpc/Kconfig: Update config option based on page size.
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.
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.
So, update the range of FORCE_MAX_ZONEORDER from 9-64 to 9-9.
--- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/Kconfig +1 -1
@@ -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 default "9" if PPC64 && PPC_64K_PAGES range 13 64 if PPC64 && !PPC_64K_PAGES default "13" if PPC64 && !PPC_64K_PAGES
Signature · 1 line
2.5.0
Quoted 7 lines · Rashmica Gupta
Currently on PPC64 changing kernel pagesize from 4K to 64K leaves
FORCE_MAX_ZONEORDERset 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)
MAX_ORDER -1 + 16 <= 24 for 64 K
and
MAX_ORDER -1 + 12 < = 24 for 4K
Your calculations are correct
Quoted 12 lines
Expanding this out, we get:
FORCE_MAX_ZONEBITS<= 25 - PAGESHIFT,which requires, for a 64K page,
FORCE_MAX_ZONEBITS<= 9. Thus set max value ofFORCE_MAX_ZONEORDERfor 64K pages to 9.Also, check the minimum value:
Ininclude/linux/huge_mm.h, we have the constraintHPAGE_PMD_ORDER<MAX_ORDERwhich expands out to:
Quoted 6 lines
PTE_INDEX_SIZE<FORCE_MAX_ZONEORDER.
PTE_INDEX_SIZEis:
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_ORDERFORCE_MAX_ZONE_ORDER -1 + 12 < = 24
The range is 9 to 13
For 64K we end up with
8 < FORCE_MAX_ZONE_ORDERFORCE_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
Quoted 12 lines
So, update the range of
FORCE_MAX_ZONEORDERfrom 9-64 to 9-9.Signed-off-by Rashmica Gupta <[email protected]>--- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/powerpc/Kconfig +0
-0
arch/powerpc/Kconfig endchoice · line 588
Quoted 5 lines
arch/powerpc/Kconfig +1
-1@@ -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?
arch/powerpc/Kconfig endchoice · line 590
Quoted 2 lines
arch/powerpc/Kconfig +0
-0default "9" if PPC64 && PPC_64K_PAGES range 13 64 if PPC64 && !PPC_64K_PAGES
Should this be fixed as well?
range 9 13?
arch/powerpc/Kconfig endchoice · line 591
Quoted 1 line
arch/powerpc/Kconfig +0
-0default "13" if PPC64 && !PPC_64K_PAGES
Please check my calculations
Balbir Singh
Quoted 11 lines · Balbir Singh
Quoted 7 lines · Rashmica Gupta
Currently on PPC64 changing kernel pagesize from 4K to 64K leaves
FORCE_MAX_ZONEORDERset 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
Quoted 7 lines
12 #ifdef
CONFIG_FORCE_MAX_ZONEORDER
13 #if ((CONFIG_FORCE_MAX_ZONEORDER- 1 +PAGE_SHIFT) >SECTION_SIZE_BITS) 14 #undefSECTION_SIZE_BITS
15 #defineSECTION_SIZE_BITS(CONFIG_FORCE_MAX_ZONEORDER- 1 +PAGE_SHIFT) 16 #endifBut coming back (we can revisit the
SECTION_SIZE_BITSdefinition later)
I feel like someone more senior than me should weigh in on if this is worth doing...
Quoted 28 lines
MAX_ORDER-1 + 16 <= 24 for 64 Kand
MAX_ORDER-1 + 12 < = 24 for 4KYour calculations are correct
Quoted 11 lines
Expanding this out, we get:
FORCE_MAX_ZONEBITS<= 25 - PAGESHIFT,which requires, for a 64K page,
FORCE_MAX_ZONEBITS<= 9. Thus set max value ofFORCE_MAX_ZONEORDERfor 64K pages to 9.Also, check the minimum value:
Ininclude/linux/huge_mm.h, we have the constraintHPAGE_PMD_ORDER<MAX_ORDERwhich expands out to:Quoted 5 lines
PTE_INDEX_SIZE<FORCE_MAX_ZONEORDER.PTE_INDEX_SIZEis:
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_ORDERFORCE_MAX_ZONE_ORDER-1 + 12 < = 24
Quoted 7 lines
The range is 9 to 13
For 64K we end up with
8 <FORCE_MAX_ZONE_ORDERFORCE_MAX_ZONE_ORDER-1 + 16 <= 24 orFORCE_MAX_ZONE_ORDER<= 9The range is really between 8 and 9 unless we tweak the
SECTION_SIZE_BITS
Yup, you are right! Might have had a brain spaz...
Quoted 13 lines
Quoted 13 lines
So, update the range of
FORCE_MAX_ZONEORDERfrom 9-64 to 9-9.Signed-off-by Rashmica Gupta <[email protected]>--- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/powerpc/Kconfig +0
-0@@ -585,7 +585,7 @@ endchoice
Quoted 5 lines
arch/powerpc/Kconfig endchoice · line 588
Quoted 4 lines
arch/powerpc/Kconfig +1
-1config FORCE_MAX_ZONEORDER int "Maximum zone order" - range 9 64 if PPC64 && PPC_64K_PAGES + range 9 9 if PPC64 && PPC_64K_PAGESrange 8 9?
Agreed.
Quoted 4 lines
arch/powerpc/Kconfig endchoice · line 590
Quoted 2 lines
arch/powerpc/Kconfig +0
-0default "9" if PPC64 && PPC_64K_PAGES range 13 64 if PPC64 && !PPC_64K_PAGESShould this be fixed as well?
range 9 13?
Agreed.
Quoted 1 line
arch/powerpc/Kconfig endchoice · line 591
Quoted 1 line
arch/powerpc/Kconfig +0
-0default "13" if PPC64 && !PPC_64K_PAGES
Should the default values remain as is, or follow the trend and be equal to the minimum value?
Quoted 5 lines
Please check my calculations
Reviewed-by Balbir Singh <[email protected]>Balbir Singh
arch/powerpc/Kconfig endchoice · line 591
Quoted 9 lines · On Friday 19 February 2016 12:55:43 Rashmica Gupta wrote:
config
FORCE_MAX_ZONEORDER
int "Maximum zone order"arch/powerpc/Kconfig +1
-1- range 9 64 if PPC64 && PPC_64K_PAGES + range 9 9 if PPC64 && PPC_64K_PAGES default "9" if PPC64 && PPC_64K_PAGES range 13 64 if PPC64 && !PPC_64K_PAGES default "13" if PPC64 && !PPC_64K_PAGES
You can also use
int "Maximum zone order" if !PPC_64K_PAGES
which will hide the option in the case where no configuration is possible.
Arnd