archive mirror
 help / color / mirror / Atom feed
From: Christian Borntraeger <>
	Christian Borntraeger <>
Subject: [PATCH] mm: trigger panic on bad page or PTE states if panic_on_oops
Date: Mon, 16 Mar 2015 09:37:01 +0100	[thread overview]
Message-ID: <> (raw)

while debugging a memory management problem it helped a lot to
get a system dump as early as possible for bad page states.

Lets assume that if panic_on_oops is set then the system should
not continue with broken mm data structures.

Signed-off-by: Christian Borntraeger <>
 mm/memory.c     | 2 ++
 mm/page_alloc.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/mm/memory.c b/mm/memory.c
index 2c3536c..bdbf9cc 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -696,6 +696,8 @@ static void print_bad_pte(struct vm_area_struct *vma, unsigned long addr,
 		printk(KERN_ALERT "vma->vm_file->f_op->mmap: %pSR\n",
+	if (panic_on_oops)
+		panic("Fatal exception");
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 8e20f9c..8c19db3 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -337,6 +337,8 @@ static void bad_page(struct page *page, const char *reason,
+	if (panic_on_oops)
+		panic("Fatal exception");
 	/* Leave bad fields for debug, except PageBuddy could make trouble */
 	page_mapcount_reset(page); /* remove PageBuddy */

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

             reply	other threads:[~2015-03-16  8:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16  8:37 Christian Borntraeger [this message]
2015-03-16 11:00 ` [PATCH] mm: trigger panic on bad page or PTE states if panic_on_oops Kirill A. Shutemov
2015-03-16 11:12   ` Christian Borntraeger
2015-03-16 12:15     ` Kirill A. Shutemov
2015-03-17 17:19       ` Konstantin Khlebnikov
2015-03-17 19:40         ` Kirill A. Shutemov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).