At presentyou can set CONFIG_HUGETLB_PAGE and not CONFIG_HUGETLBFS, which
give the kernel low-level hugepage support, but no userspace API with which
to access it.

And with the recent hugetlbfs-accounting fix, the low-level code needs
functions which are in hugetlbfs, so CONFIG_HUGETLBFS=n,
CONFIG_HUGETLB_PAGE=y doesn't even link.

So we flip things around: CONFIG_HUGETLB_PAGE is set if CONFIG_HUGETLBFS is
set and CONFIG_HUGETLB_PAGE is unset if CONFIG_HUGETLBFS is unset.  The
CONFIG_HUGETLB_PAGE hence disappears from the per-arch configuration menus.



 arch/i386/Kconfig    |   11 -----------
 arch/ia64/Kconfig    |    3 ---
 arch/ppc64/Kconfig   |   11 -----------
 arch/sparc64/Kconfig |   10 ----------
 arch/x86_64/Kconfig  |    8 --------
 fs/Kconfig           |    4 +++-
 6 files changed, 3 insertions(+), 44 deletions(-)

diff -puN arch/i386/Kconfig~CONFIG_HUGETLBFS-sets-CONFIG_HUGETLB_PAGE arch/i386/Kconfig
--- 25/arch/i386/Kconfig~CONFIG_HUGETLBFS-sets-CONFIG_HUGETLB_PAGE	2003-09-21 13:54:49.000000000 -0700
+++ 25-akpm/arch/i386/Kconfig	2003-09-21 13:54:49.000000000 -0700
@@ -397,17 +397,6 @@ config X86_OOSTORE
 	depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6
 	default y
 
-config HUGETLB_PAGE
-	bool "Huge TLB Page Support"
-	help
-	  This enables support for huge pages.  User space applications
-	  can make use of this support with the sys_alloc_hugepages and
-	  sys_free_hugepages system calls.  If your applications are
-	  huge page aware and your processor (Pentium or later for x86)
-	  supports this, then say Y here.
-
-	  Otherwise, say N.
-
 config HPET_TIMER
 	bool "HPET Timer Support"
 	help
diff -puN arch/ia64/Kconfig~CONFIG_HUGETLBFS-sets-CONFIG_HUGETLB_PAGE arch/ia64/Kconfig
--- 25/arch/ia64/Kconfig~CONFIG_HUGETLBFS-sets-CONFIG_HUGETLB_PAGE	2003-09-21 13:54:49.000000000 -0700
+++ 25-akpm/arch/ia64/Kconfig	2003-09-21 13:54:49.000000000 -0700
@@ -304,9 +304,6 @@ config FORCE_MAX_ZONEORDER
 	int
 	default "18"
 
-config HUGETLB_PAGE
-	bool "IA-64 Huge TLB Page Support"
-
 choice
 	prompt "IA-64 Huge TLB Page Size"
 	depends on HUGETLB_PAGE
diff -puN arch/ppc64/Kconfig~CONFIG_HUGETLBFS-sets-CONFIG_HUGETLB_PAGE arch/ppc64/Kconfig
--- 25/arch/ppc64/Kconfig~CONFIG_HUGETLBFS-sets-CONFIG_HUGETLB_PAGE	2003-09-21 13:54:49.000000000 -0700
+++ 25-akpm/arch/ppc64/Kconfig	2003-09-21 13:54:49.000000000 -0700
@@ -72,17 +72,6 @@ config PPC64
 	bool
 	default y
 
-config HUGETLB_PAGE
-	bool "Huge TLB Page Support"
-	help
-	  This enables support for huge pages.  User space applications
-	  can make use of this support with the sys_alloc_hugepages and
-	  sys_free_hugepages system calls.  If your applications are
-	  huge page aware and your processor supports this (only POWER4,
-	  then say Y here.
-
-	  Otherwise, say N.
-
 config SMP
 	bool "Symmetric multi-processing support"
 	---help---
diff -puN arch/sparc64/Kconfig~CONFIG_HUGETLBFS-sets-CONFIG_HUGETLB_PAGE arch/sparc64/Kconfig
--- 25/arch/sparc64/Kconfig~CONFIG_HUGETLBFS-sets-CONFIG_HUGETLB_PAGE	2003-09-21 13:54:49.000000000 -0700
+++ 25-akpm/arch/sparc64/Kconfig	2003-09-21 13:54:49.000000000 -0700
@@ -85,16 +85,6 @@ config HW_CONSOLE
 	bool
 	default y
 
-config HUGETLB_PAGE
-	bool "SPARC64 Huge TLB Page Support"
-	help
-	  This enables support for huge pages.  User space applications
-	  can make use of this support with the sys_alloc_hugepages and
-	  sys_free_hugepages system calls.  If your applications are
-	  huge page aware, then say Y here.
-
-	  Otherwise, say N.
-
 config SMP
 	bool "Symmetric multi-processing support"
 	---help---
diff -puN arch/x86_64/Kconfig~CONFIG_HUGETLBFS-sets-CONFIG_HUGETLB_PAGE arch/x86_64/Kconfig
--- 25/arch/x86_64/Kconfig~CONFIG_HUGETLBFS-sets-CONFIG_HUGETLB_PAGE	2003-09-21 13:54:49.000000000 -0700
+++ 25-akpm/arch/x86_64/Kconfig	2003-09-21 13:54:49.000000000 -0700
@@ -171,14 +171,6 @@ config MTRR
 
 	  See <file:Documentation/mtrr.txt> for more information.
 
-config HUGETLB_PAGE
-	bool "Huge TLB Page Support"
-	help
-	  This enables support for huge pages.  User space applications
-	  can make use of this support with the hugetlbfs file system
-	  To actually use it you need to pass an hugepages= argument
-	  to the kernel at boot time.
-
 config SMP
 	bool "Symmetric multi-processing support"
 	---help---
diff -puN fs/Kconfig~CONFIG_HUGETLBFS-sets-CONFIG_HUGETLB_PAGE fs/Kconfig
--- 25/fs/Kconfig~CONFIG_HUGETLBFS-sets-CONFIG_HUGETLB_PAGE	2003-09-21 13:54:49.000000000 -0700
+++ 25-akpm/fs/Kconfig	2003-09-21 13:54:49.000000000 -0700
@@ -875,7 +875,9 @@ config TMPFS
 
 config HUGETLBFS
 	bool "HugeTLB file system support"
-	depends on HUGETLB_PAGE
+
+config HUGETLB_PAGE
+	def_bool HUGETLBFS
 
 config RAMFS
 	bool

_