generic debug pagealloc: build fix
authorAkinobu Mita <akinobu.mita@gmail.com>
Thu, 2 Apr 2009 23:56:30 +0000 (16:56 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 3 Apr 2009 02:04:48 +0000 (19:04 -0700)
This fixes a build failure with generic debug pagealloc:

  mm/debug-pagealloc.c: In function 'set_page_poison':
  mm/debug-pagealloc.c:8: error: 'struct page' has no member named 'debug_flags'
  mm/debug-pagealloc.c: In function 'clear_page_poison':
  mm/debug-pagealloc.c:13: error: 'struct page' has no member named 'debug_flags'
  mm/debug-pagealloc.c: In function 'page_poison':
  mm/debug-pagealloc.c:18: error: 'struct page' has no member named 'debug_flags'
  mm/debug-pagealloc.c: At top level:
  mm/debug-pagealloc.c:120: error: redefinition of 'kernel_map_pages'
  include/linux/mm.h:1278: error: previous definition of 'kernel_map_pages' was here
  mm/debug-pagealloc.c: In function 'kernel_map_pages':
  mm/debug-pagealloc.c:122: error: 'debug_pagealloc_enabled' undeclared (first use in this function)

by fixing

 - debug_flags should be in struct page
 - define DEBUG_PAGEALLOC config option for all architectures

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reported-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/powerpc/Kconfig.debug
arch/s390/Kconfig.debug
arch/sparc/Kconfig.debug
arch/x86/Kconfig.debug
include/linux/mm_types.h
mm/Kconfig.debug

index 6aa0b5e087cd134866bcf8427f4d19ae92f6f842..a1098e23221fb1debd36fc62bf54740f1829a3e4 100644 (file)
@@ -27,16 +27,6 @@ config DEBUG_STACK_USAGE
 
          This option will slow down process creation somewhat.
 
-config DEBUG_PAGEALLOC
-        bool "Debug page memory allocations"
-        depends on DEBUG_KERNEL && !HIBERNATION
-       depends on ARCH_SUPPORTS_DEBUG_PAGEALLOC
-        help
-          Unmap pages from the kernel linear mapping after free_pages().
-          This results in a large slowdown, but helps to find certain types
-          of memory corruptions.
-
-
 config HCALL_STATS
        bool "Hypervisor call instrumentation"
        depends on PPC_PSERIES && DEBUG_FS
index 7e297a3cde34e06c4277f8ed04832d5ad675f0d1..2283933a9a93eef48b2de37aefe944540af03ff4 100644 (file)
@@ -6,13 +6,4 @@ config TRACE_IRQFLAGS_SUPPORT
 
 source "lib/Kconfig.debug"
 
-config DEBUG_PAGEALLOC
-       bool "Debug page memory allocations"
-       depends on DEBUG_KERNEL
-       depends on ARCH_SUPPORTS_DEBUG_PAGEALLOC
-       help
-         Unmap pages from the kernel linear mapping after free_pages().
-         This results in a slowdown, but helps to find certain types of
-         memory corruptions.
-
 endmenu
index d001b42041a59a7ab13bdbbf5d1c786b7db59841..90d5fe223a7458953e866aa376ebd8e5591f244b 100644 (file)
@@ -22,15 +22,6 @@ config DEBUG_DCFLUSH
 config STACK_DEBUG
        bool "Stack Overflow Detection Support"
 
-config DEBUG_PAGEALLOC
-       bool "Debug page memory allocations"
-       depends on DEBUG_KERNEL && !HIBERNATION
-       depends on ARCH_SUPPORTS_DEBUG_PAGEALLOC
-       help
-         Unmap pages from the kernel linear mapping after free_pages().
-         This results in a large slowdown, but helps to find certain types
-         of memory corruptions.
-
 config MCOUNT
        bool
        depends on SPARC64
index a345cb5447a8911f97d4cf659459a9d2639d50d4..d8359e73317f8dfb8b929f15f555f5593469e7fd 100644 (file)
@@ -72,15 +72,6 @@ config DEBUG_STACK_USAGE
 
          This option will slow down process creation somewhat.
 
-config DEBUG_PAGEALLOC
-       bool "Debug page memory allocations"
-       depends on DEBUG_KERNEL
-       depends on ARCH_SUPPORTS_DEBUG_PAGEALLOC
-       ---help---
-         Unmap pages from the kernel linear mapping after free_pages().
-         This results in a large slowdown, but helps to find certain types
-         of memory corruptions.
-
 config DEBUG_PER_CPU_MAPS
        bool "Debug access to per_cpu maps"
        depends on DEBUG_KERNEL
index ddadb4defe002956e2d7df352d6f03632c8c6f86..0e80e26ecf21220104d8d2abbeb9cca6a1215e6e 100644 (file)
@@ -95,6 +95,9 @@ struct page {
        void *virtual;                  /* Kernel virtual address (NULL if
                                           not kmapped, ie. highmem) */
 #endif /* WANT_PAGE_VIRTUAL */
+#ifdef CONFIG_WANT_PAGE_DEBUG_FLAGS
+       unsigned long debug_flags;      /* Use atomic bitops on this */
+#endif
 };
 
 /*
@@ -175,9 +178,6 @@ struct vm_area_struct {
 #ifdef CONFIG_NUMA
        struct mempolicy *vm_policy;    /* NUMA policy for the VMA */
 #endif
-#ifdef CONFIG_WANT_PAGE_DEBUG_FLAGS
-       unsigned long debug_flags;      /* Use atomic bitops on this */
-#endif
 };
 
 struct core_thread {
index c8d62d49a44e1bd8ec15e42d321da762b58c3b45..bb01e298f260b84c82b03acdfb11582e42ecbbe6 100644 (file)
@@ -1,3 +1,12 @@
+config DEBUG_PAGEALLOC
+       bool "Debug page memory allocations"
+       depends on DEBUG_KERNEL && ARCH_SUPPORTS_DEBUG_PAGEALLOC
+       depends on !HIBERNATION || !PPC && !SPARC
+       ---help---
+         Unmap pages from the kernel linear mapping after free_pages().
+         This results in a large slowdown, but helps to find certain types
+         of memory corruptions.
+
 config WANT_PAGE_DEBUG_FLAGS
        bool