Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1331686

[PATCH v2 3/5] sound: query dynamic DEBUG_PAGEALLOC setting

From js1304@gmail.com
Newsgroups linux.kernel
Subject [PATCH v2 3/5] sound: query dynamic DEBUG_PAGEALLOC setting
Date 2016-02-11 05:10 +0100
Message-ID <r0QJP-3vQ-3@gated-at.bofh.it> (permalink)
References <r0QJP-3vQ-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Joonsoo Kim <iamjoonsoo.kim@lge.com>

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.

v2: export _debug_pagealloc_enabled to modules, per Andrew.

Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
---
 mm/page_alloc.c           | 1 +
 sound/drivers/pcsp/pcsp.c | 9 +++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 87b3e2f..00118fe 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -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)
diff --git a/sound/drivers/pcsp/pcsp.c b/sound/drivers/pcsp/pcsp.c
index 27e25bb..72e2d00 100644
--- a/sound/drivers/pcsp/pcsp.c
+++ b/sound/drivers/pcsp/pcsp.c
@@ -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;
 }
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/5] follow-up "Optimize CONFIG_DEBUG_PAGEALLOC" js1304@gmail.com - 2016-02-11 05:10 +0100
  [PATCH v2 3/5] sound: query dynamic DEBUG_PAGEALLOC setting js1304@gmail.com - 2016-02-11 05:10 +0100
  [PATCH v2 2/5] mm/slub: query dynamic DEBUG_PAGEALLOC setting js1304@gmail.com - 2016-02-11 05:10 +0100
    Re: [PATCH v2 2/5] mm/slub: query dynamic DEBUG_PAGEALLOC setting Christian Borntraeger <borntraeger@de.ibm.com> - 2016-02-11 13:30 +0100
  [PATCH v2 4/5] powerpc: query dynamic DEBUG_PAGEALLOC setting js1304@gmail.com - 2016-02-11 05:10 +0100
  [PATCH v2 5/5] tile: query dynamic DEBUG_PAGEALLOC setting js1304@gmail.com - 2016-02-11 05:10 +0100
  [PATCH v2 1/5] mm/vmalloc: query dynamic DEBUG_PAGEALLOC setting js1304@gmail.com - 2016-02-11 05:10 +0100

csiph-web