diff -urN 2.4.10pre12/arch/i386/config.in highmem/arch/i386/config.in --- 2.4.10pre12/arch/i386/config.in Thu Sep 20 01:43:26 2001 +++ highmem/arch/i386/config.in Thu Sep 20 06:38:48 2001 @@ -398,6 +398,9 @@ bool ' Magic SysRq key' CONFIG_MAGIC_SYSRQ bool ' Spinlock debugging' CONFIG_DEBUG_SPINLOCK bool ' Verbose BUG() reporting (adds 70K)' CONFIG_DEBUG_BUGVERBOSE + if [ "$CONFIG_HIGHMEM" = "y" ]; then + bool 'Debug HIGHMEM on lowmem machines' CONFIG_HIGHMEM_DEBUG + fi fi endmenu diff -urN 2.4.10pre12/arch/i386/kernel/setup.c highmem/arch/i386/kernel/setup.c --- 2.4.10pre12/arch/i386/kernel/setup.c Thu Sep 20 01:43:27 2001 +++ highmem/arch/i386/kernel/setup.c Thu Sep 20 06:38:07 2001 @@ -821,7 +821,19 @@ */ #define VMALLOC_RESERVE (unsigned long)(128 << 20) #define MAXMEM (unsigned long)(-PAGE_OFFSET-VMALLOC_RESERVE) +#ifdef CONFIG_HIGHMEM_DEBUG +#define MAXMEM_PFN \ +({ \ + int __max_pfn; \ + if (max_pfn > PFN_DOWN(MAXMEM)) \ + __max_pfn = PFN_DOWN(MAXMEM); \ + else \ + __max_pfn = max_pfn / 2; \ + __max_pfn; \ +}) +#else #define MAXMEM_PFN PFN_DOWN(MAXMEM) +#endif #define MAX_NONPAE_PFN (1 << 20) /*