sound: query dynamic DEBUG_PAGEALLOC setting
authorJoonsoo Kim <[email protected]>
Thu, 17 Mar 2016 21:17:56 +0000 (14:17 -0700)
committerLinus Torvalds <[email protected]>
Thu, 17 Mar 2016 22:09:34 +0000 (15:09 -0700)
We can disable debug_pagealloc processing even if the code is compiled
with CONFIG_DEBUG_PAGEALLOC.  This patch changes the code to query
whether it is enabled or not in runtime.

[[email protected]: export _debug_pagealloc_enabled to modules]
Signed-off-by: Joonsoo Kim <[email protected]>
Acked-by: David Rientjes <[email protected]>
Acked-by: Takashi Iwai <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Chris Metcalf <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Pekka Enberg <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/page_alloc.c
sound/drivers/pcsp/pcsp.c

index c7332a4bc8dbdbb4ee37e312f967c56bbef177fa..b1fc19ebb8a2ddd29ad6f6c290e4bd205eb4fbb4 100644 (file)
@@ -498,6 +498,7 @@ void prep_compound_page(struct page *page, unsigned int order)
 unsigned int _debug_guardpage_minorder;
 bool _debug_pagealloc_enabled __read_mostly
                        = IS_ENABLED(CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT);
+EXPORT_SYMBOL(_debug_pagealloc_enabled);
 bool _debug_guardpage_enabled __read_mostly;
 
 static int __init early_debug_pagealloc(char *buf)
index 27e25bb78c9782a5ba9fff5933d495eb4f200878..72e2d0012084730498123aee36ca4d35bb3a2a7e 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/input.h>
 #include <linux/delay.h>
 #include <linux/bitops.h>
+#include <linux/mm.h>
 #include "pcsp_input.h"
 #include "pcsp.h"
 
@@ -148,11 +149,11 @@ static int alsa_card_pcsp_init(struct device *dev)
                return err;
        }
 
-#ifdef CONFIG_DEBUG_PAGEALLOC
        /* Well, CONFIG_DEBUG_PAGEALLOC makes the sound horrible. Lets alert */
-       printk(KERN_WARNING "PCSP: CONFIG_DEBUG_PAGEALLOC is enabled, "
-              "which may make the sound noisy.\n");
-#endif
+       if (debug_pagealloc_enabled()) {
+               printk(KERN_WARNING "PCSP: CONFIG_DEBUG_PAGEALLOC is enabled, "
+                      "which may make the sound noisy.\n");
+       }
 
        return 0;
 }