linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] additional CONFIG_DEBUG_PAGEALLOC change
@ 2016-01-29 12:52 Christian Borntraeger
  2016-01-29 12:52 ` [PATCH 1/1] x86: also use debug_pagealloc_enabled() for free_init_pages Christian Borntraeger
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Christian Borntraeger @ 2016-01-29 12:52 UTC (permalink / raw)
  To: akpm
  Cc: linux-kernel, linux-mm, x86, Joonsoo Kim, davej, David Rientjes,
	Thomas Gleixner, Christian Borntraeger

As suggested by David Rientjes, we should also change free_init_pages.

Can be merged with "x86: query dynamic DEBUG_PAGEALLOC setting"
or go as addon patch.


Christian Borntraeger (1):
  x86: also use debug_pagealloc_enabled() for free_init_pages

 arch/x86/mm/init.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

-- 
2.3.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] x86: also use debug_pagealloc_enabled() for free_init_pages
  2016-01-29 12:52 [PATCH 0/1] additional CONFIG_DEBUG_PAGEALLOC change Christian Borntraeger
@ 2016-01-29 12:52 ` Christian Borntraeger
  2016-01-29 13:59   ` Thomas Gleixner
  2016-01-29 12:52 ` [PATCH 0/1] additional CONFIG_DEBUG_PAGEALLOC change Christian Borntraeger
  2016-01-29 12:52 ` [PATCH 1/1] x86: also use debug_pagealloc_enabled() for free_init_pages Christian Borntraeger
  2 siblings, 1 reply; 5+ messages in thread
From: Christian Borntraeger @ 2016-01-29 12:52 UTC (permalink / raw)
  To: akpm
  Cc: linux-kernel, linux-mm, x86, Joonsoo Kim, davej, David Rientjes,
	Thomas Gleixner, Christian Borntraeger

we want to couple all debugging features with debug_pagealloc_enabled()
and not with the config option CONFIG_DEBUG_PAGEALLOC.

Suggested-by: David Rientjes <rientjes@google.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 arch/x86/mm/init.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 39823fd..9d56f27 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -667,21 +667,22 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
 	 * mark them not present - any buggy init-section access will
 	 * create a kernel page fault:
 	 */
-#ifdef CONFIG_DEBUG_PAGEALLOC
-	printk(KERN_INFO "debug: unmapping init [mem %#010lx-%#010lx]\n",
-		begin, end - 1);
-	set_memory_np(begin, (end - begin) >> PAGE_SHIFT);
-#else
-	/*
-	 * We just marked the kernel text read only above, now that
-	 * we are going to free part of that, we need to make that
-	 * writeable and non-executable first.
-	 */
-	set_memory_nx(begin, (end - begin) >> PAGE_SHIFT);
-	set_memory_rw(begin, (end - begin) >> PAGE_SHIFT);
+	if (debug_pagealloc_enabled()) {
+		pr_info("debug: unmapping init [mem %#010lx-%#010lx]\n",
+			begin, end - 1);
+		set_memory_np(begin, (end - begin) >> PAGE_SHIFT);
+	} else {
+		/*
+		 * We just marked the kernel text read only above, now that
+		 * we are going to free part of that, we need to make that
+		 * writeable and non-executable first.
+		 */
+		set_memory_nx(begin, (end - begin) >> PAGE_SHIFT);
+		set_memory_rw(begin, (end - begin) >> PAGE_SHIFT);
 
-	free_reserved_area((void *)begin, (void *)end, POISON_FREE_INITMEM, what);
-#endif
+		free_reserved_area((void *)begin, (void *)end,
+				   POISON_FREE_INITMEM, what);
+	}
 }
 
 void free_initmem(void)
-- 
2.3.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 0/1] additional CONFIG_DEBUG_PAGEALLOC change
  2016-01-29 12:52 [PATCH 0/1] additional CONFIG_DEBUG_PAGEALLOC change Christian Borntraeger
  2016-01-29 12:52 ` [PATCH 1/1] x86: also use debug_pagealloc_enabled() for free_init_pages Christian Borntraeger
@ 2016-01-29 12:52 ` Christian Borntraeger
  2016-01-29 12:52 ` [PATCH 1/1] x86: also use debug_pagealloc_enabled() for free_init_pages Christian Borntraeger
  2 siblings, 0 replies; 5+ messages in thread
From: Christian Borntraeger @ 2016-01-29 12:52 UTC (permalink / raw)
  To: akpm
  Cc: linux-kernel, linux-mm, x86, Joonsoo Kim, davej, David Rientjes,
	Thomas Gleixner, Christian Borntraeger

As suggested by David Rientjes, we should also change free_init_pages.

Can be merged with "x86: query dynamic DEBUG_PAGEALLOC setting"
or go as addon patch.


Christian Borntraeger (1):
  x86: also use debug_pagealloc_enabled() for free_init_pages

 arch/x86/mm/init.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

-- 
2.3.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] x86: also use debug_pagealloc_enabled() for free_init_pages
  2016-01-29 12:52 [PATCH 0/1] additional CONFIG_DEBUG_PAGEALLOC change Christian Borntraeger
  2016-01-29 12:52 ` [PATCH 1/1] x86: also use debug_pagealloc_enabled() for free_init_pages Christian Borntraeger
  2016-01-29 12:52 ` [PATCH 0/1] additional CONFIG_DEBUG_PAGEALLOC change Christian Borntraeger
@ 2016-01-29 12:52 ` Christian Borntraeger
  2 siblings, 0 replies; 5+ messages in thread
From: Christian Borntraeger @ 2016-01-29 12:52 UTC (permalink / raw)
  To: akpm
  Cc: linux-kernel, linux-mm, x86, Joonsoo Kim, davej, David Rientjes,
	Thomas Gleixner, Christian Borntraeger

we want to couple all debugging features with debug_pagealloc_enabled()
and not with the config option CONFIG_DEBUG_PAGEALLOC.

Suggested-by: David Rientjes <rientjes@google.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 arch/x86/mm/init.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 39823fd..9d56f27 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -667,21 +667,22 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
 	 * mark them not present - any buggy init-section access will
 	 * create a kernel page fault:
 	 */
-#ifdef CONFIG_DEBUG_PAGEALLOC
-	printk(KERN_INFO "debug: unmapping init [mem %#010lx-%#010lx]\n",
-		begin, end - 1);
-	set_memory_np(begin, (end - begin) >> PAGE_SHIFT);
-#else
-	/*
-	 * We just marked the kernel text read only above, now that
-	 * we are going to free part of that, we need to make that
-	 * writeable and non-executable first.
-	 */
-	set_memory_nx(begin, (end - begin) >> PAGE_SHIFT);
-	set_memory_rw(begin, (end - begin) >> PAGE_SHIFT);
+	if (debug_pagealloc_enabled()) {
+		pr_info("debug: unmapping init [mem %#010lx-%#010lx]\n",
+			begin, end - 1);
+		set_memory_np(begin, (end - begin) >> PAGE_SHIFT);
+	} else {
+		/*
+		 * We just marked the kernel text read only above, now that
+		 * we are going to free part of that, we need to make that
+		 * writeable and non-executable first.
+		 */
+		set_memory_nx(begin, (end - begin) >> PAGE_SHIFT);
+		set_memory_rw(begin, (end - begin) >> PAGE_SHIFT);
 
-	free_reserved_area((void *)begin, (void *)end, POISON_FREE_INITMEM, what);
-#endif
+		free_reserved_area((void *)begin, (void *)end,
+				   POISON_FREE_INITMEM, what);
+	}
 }
 
 void free_initmem(void)
-- 
2.3.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] x86: also use debug_pagealloc_enabled() for free_init_pages
  2016-01-29 12:52 ` [PATCH 1/1] x86: also use debug_pagealloc_enabled() for free_init_pages Christian Borntraeger
@ 2016-01-29 13:59   ` Thomas Gleixner
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Gleixner @ 2016-01-29 13:59 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: akpm, linux-kernel, linux-mm, x86, Joonsoo Kim, davej, David Rientjes

On Fri, 29 Jan 2016, Christian Borntraeger wrote:

> we want to couple all debugging features with debug_pagealloc_enabled()
> and not with the config option CONFIG_DEBUG_PAGEALLOC.
> 
> Suggested-by: David Rientjes <rientjes@google.com>
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-29 14:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-29 12:52 [PATCH 0/1] additional CONFIG_DEBUG_PAGEALLOC change Christian Borntraeger
2016-01-29 12:52 ` [PATCH 1/1] x86: also use debug_pagealloc_enabled() for free_init_pages Christian Borntraeger
2016-01-29 13:59   ` Thomas Gleixner
2016-01-29 12:52 ` [PATCH 0/1] additional CONFIG_DEBUG_PAGEALLOC change Christian Borntraeger
2016-01-29 12:52 ` [PATCH 1/1] x86: also use debug_pagealloc_enabled() for free_init_pages Christian Borntraeger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox