[rh7] mm: issue panic() on bad page/pte bugs if panic_on_warn is set.

Submitted by Andrey Ryabinin on Oct. 5, 2017, 3:04 p.m.

Details

Message ID 20171005150400.21393-1-aryabinin@virtuozzo.com
State New
Series "mm: issue panic() on bad page/pte bugs if panic_on_warn is set."
Headers show

Commit Message

Andrey Ryabinin Oct. 5, 2017, 3:04 p.m.
Bad page state bugs is serious issue. It's worth issue panic if
panic_on_warn is set to collect crash dump and catch issue earlier.

https://jira.sw.ru/browse/PSBM-70168
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 mm/memory.c     | 2 ++
 mm/page_alloc.c | 2 ++
 2 files changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/mm/memory.c b/mm/memory.c
index c30a042cebf5..b1c6968f1746 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -733,6 +733,8 @@  static void print_bad_pte(struct vm_area_struct *vma, unsigned long addr,
 		       vma->vm_file->f_op->mmap);
 	dump_stack();
 	add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);
+	if (panic_on_warn)
+		panic("panic_on_warn set ...\n");
 }
 
 /*
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 0ee5e9afd433..137d1d86ddf4 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -463,6 +463,8 @@  out:
 	/* Leave bad fields for debug, except PageBuddy could make trouble */
 	page_mapcount_reset(page); /* remove PageBuddy */
 	add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE);
+	if (panic_on_warn)
+		panic("panic_on_warn set ...\n");
 }
 
 /*