HugeTLB vs. SH3 cpu
Subsystems (6)
fs/Kconfig says:
config HUGETLBFS
bool "HugeTLB file system support"
depends on X86 || IA64 || PPC64 || SPARC64 || (SUPERH && MMU) || BROKEN
arch/sh/mm/Kconfig says:
choice
prompt "HugeTLB page size"
depends on HUGETLB_PAGE && (CPU_SH4 || CPU_SH5) && MMU
The compiler says with CONFIG_CPU_SH3:
<-- snip -->
...
CC arch/sh/mm/hugetlbpage.o
In file included from /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/mm/hugetlbpage.c:14:/home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/hugetlb.h: In function 'prepare_hugepage_range':/home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/hugetlb.h:73: error: 'HPAGE_SHIFT' undeclared (first use in this function) /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/hugetlb.h:73: error: (Each undeclared identifier is reported only once /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/hugetlb.h:73: error: for each function it appears in.)
make[2]: *** [arch/sh/mm/hugetlbpage.o] Error 1
<-- snip -->
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedQuoted 7 lines · Adrian Bunk
fs/Kconfig says:
config HUGETLBFS
bool "HugeTLB file system support"
depends on X86 || IA64 || PPC64 || SPARC64 || (SUPERH && MMU) || BROKEN
Quoted 5 lines
arch/sh/mm/Kconfigsays:choice
prompt "HugeTLB page size"
depends onHUGETLB_PAGE&& (CPU_SH4||CPU_SH5) && MMU
So the problem is that SH3 is allowed to enable HUGETLB_PAGE/HUGETLBFS, but only SH4/5 define the HPAGE_SHIFT macro, due to some #ifdeffery on the hugepage size. So either the choice needs to be extended to include CPU_SH3 (which builds here, when changed) or the HUGETLBFS conditional needs to depend more specifically on SH4/5 and not just SUPERH. I think the arch maintainer has to make that call, as I don't know the hardware to say if SH3 actually supports multiple hugepage sizes.
Thanks,
Nish
Quoted 14 lines · Nish Aravamudan
Quoted 7 lines · Adrian Bunk
fs/Kconfig says:
config HUGETLBFS
bool "HugeTLB file system support"
depends on X86 || IA64 || PPC64 || SPARC64 || (SUPERH && MMU) || BROKENQuoted 5 lines
arch/sh/mm/Kconfigsays:choice
prompt "HugeTLB page size"
depends onHUGETLB_PAGE&& (CPU_SH4||CPU_SH5) && MMU
Quoted 9 lines
So the problem is that SH3 is allowed to enable HUGETLB_PAGE/HUGETLBFS, but only SH4/5 define the
HPAGE_SHIFTmacro, due to some #ifdeffery on the hugepage size. So either the choice needs to be extended to includeCPU_SH3(which builds here, when changed) or the HUGETLBFS conditional needs to depend more specifically on SH4/5 and not just SUPERH. I think the arch maintainer has to make that call, as I don't know the hardware to say if SH3 actually supports multiple hugepage sizes.
The problem is that the hugetlb Kconfig stuff is a complete mess. There's a semi-decoupling between HUGETLBFS and HUGETLB_PAGE, though they both depend on each other.
Sorting out the mess noted by Adrian is pretty trivial with a HAVE_HUGETLB_PAGE. How about this?
---
arch/ia64/Kconfig | 1 + arch/powerpc/platforms/Kconfig.cputype | 1 + arch/sh/Kconfig | 2 ++ arch/sparc64/Kconfig | 1 + arch/x86/Kconfig | 1 + fs/Kconfig | 3 ++- mm/Kconfig | 3 +++ 7 files changed, 11 insertions(+), 1 deletion(-)
arch/ia64/Kconfig +1 -0
@@ -19,6 +19,7 @@ config IA64 select HAVE_OPROFILE select HAVE_KPROBES select HAVE_KRETPROBES + select HAVE_HUGETLB_PAGE default y help The Itanium Processor Family is Intel's 64-bit successor to
arch/powerpc/platforms/Kconfig.cputype +1 -0
@@ -1,5 +1,6 @@ config PPC64 bool "64-bit kernel" + select HAVE_HUGETLB_PAGE default n help This option selects whether a 32-bit or a 64-bit kernel
arch/sh/Kconfig +2 -0
@@ -114,6 +114,7 @@ config CPU_SH3 config CPU_SH4 bool + select HAVE_HUGETLB_PAGE select CPU_HAS_INTEVT select CPU_HAS_SR_RB select CPU_HAS_PTEA if !CPU_SH4A || CPU_SHX2
@@ -130,6 +131,7 @@ config CPU_SH4AL_DSP config CPU_SH5 bool + select HAVE_HUGETLB_PAGE select CPU_HAS_FPU config CPU_SHX2
arch/sparc64/Kconfig +1 -0
@@ -16,6 +16,7 @@ config SPARC64 bool default y select HAVE_IDE + select HAVE_HUGETLB_PAGE help SPARC is a family of RISC microprocessors designed and marketed by Sun Microsystems, incorporated. This port covers the newer 64-bit
arch/x86/Kconfig +1 -0
@@ -22,6 +22,7 @@ config X86 select HAVE_OPROFILE select HAVE_KPROBES select HAVE_KRETPROBES + select HAVE_HUGETLB_PAGE select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)
fs/Kconfig +2 -1
@@ -978,7 +978,7 @@ config TMPFS_POSIX_ACL config HUGETLBFS bool "HugeTLB file system support" - depends on X86 || IA64 || PPC64 || SPARC64 || (SUPERH && MMU) || BROKEN + depends on HAVE_HUGETLB_PAGE || BROKEN help hugetlbfs is a filesystem backing for HugeTLB pages, based on ramfs. For architectures that support it, say Y here and read
@@ -987,6 +987,7 @@ config HUGETLBFS If unsure, say N. config HUGETLB_PAGE + depends on MMU def_bool HUGETLBFS config CONFIGFS_FS
mm/Kconfig +3 -0
@@ -90,6 +90,9 @@ config HAVE_MEMORY_PRESENT def_bool y depends on ARCH_HAVE_MEMORY_PRESENT || SPARSEMEM +config HAVE_HUGETLB_PAGE + def_bool n + # # SPARSEMEM_EXTREME (which is the default) does some bootmem # allocations when memory_present() is called. If this cannot
Mel Gorman
Acked-byOn (02/04/08 17:04), Paul Mundt didst pronounce:
Quoted 24 lines · Nish Aravamudan
Quoted 14 lines · Adrian Bunk
Quoted 7 lines
fs/Kconfig says:
config HUGETLBFS
bool "HugeTLB file system support"
depends on X86 || IA64 || PPC64 || SPARC64 || (SUPERH && MMU) || BROKENQuoted 5 lines
arch/sh/mm/Kconfigsays:choice
prompt "HugeTLB page size"
depends onHUGETLB_PAGE&& (CPU_SH4||CPU_SH5) && MMUQuoted 9 lines
So the problem is that SH3 is allowed to enable HUGETLB_PAGE/HUGETLBFS, but only SH4/5 define the
HPAGE_SHIFTmacro, due to some #ifdeffery on the hugepage size. So either the choice needs to be extended to includeCPU_SH3(which builds here, when changed) or the HUGETLBFS conditional needs to depend more specifically on SH4/5 and not just SUPERH. I think the arch maintainer has to make that call, as I don't know the hardware to say if SH3 actually supports multiple hugepage sizes.
Quoted 4 lines
The problem is that the hugetlb
Kconfigstuff is a complete mess. There's a semi-decoupling between HUGETLBFS andHUGETLB_PAGE, though they both depend on each other.
I believe the original intention was that HUGETLB_PAGE would build the hugepage pool and the arch-specific code and HUGETLBFS would be the userspace interface but not necessarily the only one. Whatever the original intention, it's no longer the case as they have become inter-dependant. Fixing it is not straight-forward but I don't think we want to collapse HUGETLB_PAGE and HUGETLBFS just yet either.
Quoted 3 lines
Sorting out the mess noted by Adrian is pretty trivial with a
HAVE_HUGETLB_PAGE. How about this?
While I am loathe to add yet more hugetlb-related Kconfig options, this does seem to be the common way of dealing with features that depend on the architecture (e.g. HAVE_OPROFILE, HAVE_IDE, HAVE_KPROBES etc.).
Quoted 2 lines
Signed-off-by Paul Mundt <[email protected]>
It appears to be doing the right thing making defconfig across the different architectures.
Quoted 28 lines
---
arch/ia64/Kconfig | 1 + arch/powerpc/platforms/Kconfig.cputype | 1 + arch/sh/Kconfig | 2 ++ arch/sparc64/Kconfig | 1 + arch/x86/Kconfig | 1 + fs/Kconfig | 3 ++- mm/Kconfig | 3 +++ 7 files changed, 11 insertions(+), 1 deletion(-)arch/ia64/Kconfig +1
-0@@ -19,6 +19,7 @@ config IA64 select HAVE_OPROFILE select HAVE_KPROBES select HAVE_KRETPROBES + select HAVE_HUGETLB_PAGE default y help The Itanium Processor Family is Intel's 64-bit successor toarch/powerpc/platforms/Kconfig.cputype +0
-0
arch/powerpc/platforms/Kconfig.cputype line 6
Quoted 6 lines
arch/powerpc/platforms/Kconfig.cputype +1
-0@@ -1,5 +1,6 @@ config PPC64 bool "64-bit kernel" + select HAVE_HUGETLB_PAGE default n help This option selects whether a 32-bit or a 64-bit kernel
hmm... This is what Kconfig is currently doing but by rights, it should be set on a per-processor basis. I guess it's outside the scope of this patch as there isn't an obvious way to tell what processor versions support huge pages.
Quoted 79 lines
arch/sh/Kconfig +2
-0@@ -114,6 +114,7 @@ config CPU_SH3 config CPU_SH4 bool + select HAVE_HUGETLB_PAGE select CPU_HAS_INTEVT select CPU_HAS_SR_RB select CPU_HAS_PTEA if !CPU_SH4A || CPU_SHX2@@ -130,6 +131,7 @@ config CPU_SH4AL_DSP config CPU_SH5 bool + select HAVE_HUGETLB_PAGE select CPU_HAS_FPU config CPU_SHX2arch/sparc64/Kconfig +1
-0@@ -16,6 +16,7 @@ config SPARC64 bool default y select HAVE_IDE + select HAVE_HUGETLB_PAGE help SPARC is a family of RISC microprocessors designed and marketed by Sun Microsystems, incorporated. This port covers the newer 64-bitarch/x86/Kconfig +1
-0@@ -22,6 +22,7 @@ config X86 select HAVE_OPROFILE select HAVE_KPROBES select HAVE_KRETPROBES + select HAVE_HUGETLB_PAGE select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)fs/Kconfig +2
-1@@ -978,7 +978,7 @@ config TMPFS_POSIX_ACL config HUGETLBFS bool "HugeTLB file system support" - depends on X86 || IA64 || PPC64 || SPARC64 || (SUPERH && MMU) || BROKEN + depends on HAVE_HUGETLB_PAGE || BROKEN help hugetlbfs is a filesystem backing for HugeTLB pages, based on ramfs. For architectures that support it, say Y here and read@@ -987,6 +987,7 @@ config HUGETLBFS If unsure, say N. config HUGETLB_PAGE + depends on MMU def_bool HUGETLBFS config CONFIGFS_FSmm/Kconfig +3
-0@@ -90,6 +90,9 @@ config HAVE_MEMORY_PRESENT def_bool y depends on ARCH_HAVE_MEMORY_PRESENT || SPARSEMEM +config HAVE_HUGETLB_PAGE + def_bool n + # # SPARSEMEM_EXTREME (which is the default) does some bootmem # allocations when memory_present() is called. If this cannot
Signature · 3 lines
Mel Gorman Part-time Phd Student Linux Technology Center University of Limerick IBM Dublin Software Lab
Quoted 24 lines · Paul Mundt
Quoted 14 lines · Nish Aravamudan
Quoted 7 lines · Adrian Bunk
fs/Kconfig says:
config HUGETLBFS
bool "HugeTLB file system support"
depends on X86 || IA64 || PPC64 || SPARC64 || (SUPERH && MMU) || BROKENQuoted 5 lines
arch/sh/mm/Kconfigsays:choice
prompt "HugeTLB page size"
depends onHUGETLB_PAGE&& (CPU_SH4||CPU_SH5) && MMUQuoted 9 lines
So the problem is that SH3 is allowed to enable HUGETLB_PAGE/HUGETLBFS, but only SH4/5 define the
HPAGE_SHIFTmacro, due to some #ifdeffery on the hugepage size. So either the choice needs to be extended to includeCPU_SH3(which builds here, when changed) or the HUGETLBFS conditional needs to depend more specifically on SH4/5 and not just SUPERH. I think the arch maintainer has to make that call, as I don't know the hardware to say if SH3 actually supports multiple hugepage sizes.
Quoted 6 lines
The problem is that the hugetlb
Kconfigstuff is a complete mess. There's a semi-decoupling between HUGETLBFS andHUGETLB_PAGE, though they both depend on each other.Sorting out the mess noted by Adrian is pretty trivial with a
HAVE_HUGETLB_PAGE. How about this?
I'm confused, isn't the following simpler fix equivalent?
Fix sh3 build with HUGETLBFS=y. Only SH4 and SH5 actually support HUGETLB_PAGE (which HUGETLBFS depends on).
fs/Kconfig +1 -1
@@ -978,7 +978,7 @@ config TMPFS_POSIX_ACL config HUGETLBFS bool "HugeTLB file system support" - depends on X86 || IA64 || PPC64 || SPARC64 || (SUPERH && MMU) || BROKEN + depends on X86 || IA64 || PPC64 || SPARC64 || ((CPU_SH4 || CPU_SH5) && MMU) || BROKEN help hugetlbfs is a filesystem backing for HugeTLB pages, based on ramfs. For architectures that support it, say Y here and read
Quoted 17 lines · Nishanth Aravamudan
Quoted 3 lines · Paul Mundt
On Tue, Apr 01, 2008 at 04:26:14PM -0700, Nish Aravamudan wrote:
Sorting out the mess noted by Adrian is pretty trivial with aHAVE_HUGETLB_PAGE. How about this?I'm confused, isn't the following simpler fix equivalent?
Fix sh3 build with HUGETLBFS=y. Only SH4 and SH5 actually support
HUGETLB_PAGE(which HUGETLBFS depends on).Signed-off-by Nishanth Aravamudan <[email protected]>fs/Kconfig +0
-0
fs/Kconfig config TMPFS_POSIX_ACL · line 981
Quoted 5 lines
fs/Kconfig +1
-1@@ -978,7 +978,7 @@ config TMPFS_POSIX_ACL config HUGETLBFS bool "HugeTLB file system support" - depends on X86 || IA64 || PPC64 || SPARC64 || (SUPERH && MMU) || BROKEN + depends on X86 || IA64 || PPC64 || SPARC64 || ((CPU_SH4 || CPU_SH5) && MMU) || BROKEN
Yeah, that's equivalent. But, you have to draw the line at some point on how complex that "depends on" is going to get. I think you each have unique pain tolerances. :)
Personally, I kinda prefer to break it out per-arch, because that SUPERH logic is getting a bit screwy.
You could also do something like this:
fs/Kconfig config TMPFS_POSIX_ACL
Quoted 4 lines
fs/Kconfig +1
-1config HUGETLBFS bool "HugeTLB file system support" - depends on X86 || IA64 || PPC64 || SPARC64 || (SUPERH && MMU) || BROKEN + depends on X86 || IA64 || PPC64 || SPARC64 || SUPERH_HUGETLBFS || BROKEN
And then:
config SUPERH_HUGETLBFS
def_bool y depends on (CPU_SH4 || CPU_SH5) && MMU
on the arch-specific side.
-- Dave
Quoted 40 lines · Dave Hansen
Quoted 17 lines · Nishanth Aravamudan
Quoted 3 lines · Paul Mundt
On Tue, Apr 01, 2008 at 04:26:14PM -0700, Nish Aravamudan wrote:
Sorting out the mess noted by Adrian is pretty trivial with aHAVE_HUGETLB_PAGE. How about this?I'm confused, isn't the following simpler fix equivalent?
Fix sh3 build with HUGETLBFS=y. Only SH4 and SH5 actually support
HUGETLB_PAGE(which HUGETLBFS depends on).Signed-off-by Nishanth Aravamudan <[email protected]>fs/Kconfig +0
-0fs/Kconfig config TMPFS_POSIX_ACL · line 981
Quoted 5 lines
fs/Kconfig +1
-1@@ -978,7 +978,7 @@ config TMPFS_POSIX_ACL config HUGETLBFS bool "HugeTLB file system support" - depends on X86 || IA64 || PPC64 || SPARC64 || (SUPERH && MMU) || BROKEN + depends on X86 || IA64 || PPC64 || SPARC64 || ((CPU_SH4 || CPU_SH5) && MMU) || BROKENYeah, that's equivalent. But, you have to draw the line at some point on how complex that "depends on" is going to get. I think you each have unique pain tolerances. :)
Personally, I kinda prefer to break it out per-arch, because that SUPERH logic is getting a bit screwy.
You could also do something like this:
fs/Kconfig config TMPFS_POSIX_ACL
Quoted 4 lines
fs/Kconfig +1
-1config HUGETLBFS bool "HugeTLB file system support" - depends on X86 || IA64 || PPC64 || SPARC64 || (SUPERH && MMU) || BROKEN + depends on X86 || IA64 || PPC64 || SPARC64 || SUPERH_HUGETLBFS || BROKENAnd then:
Quoted 6 lines
config
SUPERH_HUGETLBFSdef_bool y depends on (CPU_SH4 || CPU_SH5) && MMUon the arch-specific side.
SUPERH has the MMU dependence because it's the only one out of that list of architectures that supports both CONFIG_MMU=y and CONFIG_MMU=n configurations. The dependence on CONFIG_MMU should be tied in to the HUGETLBFS dependency directly, which is what my patch did.
The other issue is that the dependencies here are just totally backwards. the file system has the architecture dependence which enables support for the hugetlb page feature, while the architectures should simply select whether they can support the hugetlb pages or not and have the file system conditionalized on that. A bit more work is needed to have HUGETLBFS and HUGETLB_PAGE toggling independently of each other without breaking, but that's certainly the next logical step.
Quoted 5 lines · Mel Gorman
On (02/04/08 17:04), Paul Mundt didst pronounce:
Quoted 3 lines
The problem is that the hugetlb
Kconfigstuff is a complete mess. There's a semi-decoupling between HUGETLBFS andHUGETLB_PAGE, though they both depend on each other.
Quoted 7 lines
I believe the original intention was that
HUGETLB_PAGEwould build the hugepage pool and the arch-specific code and HUGETLBFS would be the userspace interface but not necessarily the only one. Whatever the original intention, it's no longer the case as they have become inter-dependant. Fixing it is not straight-forward but I don't think we want to collapseHUGETLB_PAGEand HUGETLBFS just yet either.
That makes more sense, perhaps it's worth beating in to shape so there can also be non hugetlbfs users, this needs a bit of use-case thinking, though.
Quoted 7 lines
Quoted 7 lines
arch/powerpc/platforms/Kconfig.cputype +0
-0@@ -1,5 +1,6 @@ config PPC64 bool "64-bit kernel"
Quoted 9 lines
arch/powerpc/platforms/Kconfig.cputype line 6
Quoted 4 lines
arch/powerpc/platforms/Kconfig.cputype +1
-0+ select HAVE_HUGETLB_PAGE default n help This option selects whether a 32-bit or a 64-bit kernelhmm... This is what
Kconfigis currently doing but by rights, it should be set on a per-processor basis. I guess it's outside the scope of this patch as there isn't an obvious way to tell what processor versions support huge pages.
Yes, I had the same thoughts, perhaps the PPC64 folks can shed some light on this.