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


Groups > linux.kernel > #1331689

[PATCH v2 5/5] tile: query dynamic DEBUG_PAGEALLOC setting

From js1304@gmail.com
Newsgroups linux.kernel
Subject [PATCH v2 5/5] tile: query dynamic DEBUG_PAGEALLOC setting
Date 2016-02-11 05:10 +0100
Message-ID <r0QJQ-3vQ-13@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.

Acked-by: Chris Metcalf <cmetcalf@ezchip.com>
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
---
 arch/tile/mm/init.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/tile/mm/init.c b/arch/tile/mm/init.c
index d4e1fc4..a0582b7 100644
--- a/arch/tile/mm/init.c
+++ b/arch/tile/mm/init.c
@@ -896,17 +896,15 @@ void __init pgtable_cache_init(void)
 		panic("pgtable_cache_init(): Cannot create pgd cache");
 }
 
-#ifdef CONFIG_DEBUG_PAGEALLOC
-static long __write_once initfree;
-#else
 static long __write_once initfree = 1;
-#endif
+static bool __write_once set_initfree_done;
 
 /* Select whether to free (1) or mark unusable (0) the __init pages. */
 static int __init set_initfree(char *str)
 {
 	long val;
 	if (kstrtol(str, 0, &val) == 0) {
+		set_initfree_done = true;
 		initfree = val;
 		pr_info("initfree: %s free init pages\n",
 			initfree ? "will" : "won't");
@@ -919,6 +917,11 @@ static void free_init_pages(char *what, unsigned long begin, unsigned long end)
 {
 	unsigned long addr = (unsigned long) begin;
 
+	/* Prefer user request first */
+	if (!set_initfree_done) {
+		if (debug_pagealloc_enabled())
+			initfree = 0;
+	}
 	if (kdata_huge && !initfree) {
 		pr_warn("Warning: ignoring initfree=0: incompatible with kdata=huge\n");
 		initfree = 1;
-- 
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