[Devel] [PATCH rh7] mm: issue panic() on bad page/pte bugs if panic_on_warn is set.
Andrey Ryabinin
aryabinin at virtuozzo.com
Thu Oct 5 18:04:00 MSK 2017
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 at virtuozzo.com>
---
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 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");
}
/*
--
2.13.6
More information about the Devel
mailing list