History

Merge branch 'akpm' (patches from Andrew)

Merge yet more updates from Andrew Morton: "A few final bits: - large changes to vmalloc, yielding large performance benefits - tweak the console-flush-on-panic code - a few fixes" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: panic: add an option to replay all the printk message in buffer initramfs: don't free a non-existent initrd fs/writeback.c: use rcu_barrier() to wait for inflight wb switches going into workqueue when umount mm/compaction.c: correct zone boundary handling when isolating pages from a pageblock mm/vmap: add DEBUG_AUGMENT_LOWEST_MATCH_CHECK macro mm/vmap: add DEBUG_AUGMENT_PROPAGATE_CHECK macro mm/vmalloc.c: keep track of free blocks for vmap allocation

Linus Torvalds committed 7 years ago

Commit cb6f8732 parents ff8583d de6da1e10 files · +889 −257Browse files

Showing the changes to kernel (2 of 10 files). Show all

Unified · Split

2 files
  1. kernel/panic.c +5 −1
  2. kernel/printk/printk.c +11 −1
kernel/panic.c+5−1
@@ -51,6 +51,7 @@ EXPORT_SYMBOL_GPL(panic_timeout); · 50 unmodified lines
5151 #define PANIC_PRINT_TIMER_INFO 0x00000004
5252 #define PANIC_PRINT_LOCK_INFO 0x00000008
5353 #define PANIC_PRINT_FTRACE_INFO 0x00000010
54+#define PANIC_PRINT_ALL_PRINTK_MSG 0x00000020
5455 unsigned long panic_print;
5556
5657 ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
@@ -134,6 +135,9 @@ EXPORT_SYMBOL(nmi_panic); · 77 unmodified lines
134135
135136 static void panic_print_sys_info(void)
136137 {
138+ if (panic_print & PANIC_PRINT_ALL_PRINTK_MSG)
139+ console_flush_on_panic(CONSOLE_REPLAY_ALL);
140+
137141 if (panic_print & PANIC_PRINT_TASK_INFO)
138142 show_state();
139143
@@ -277,7 +281,7 @@ void panic(const char *fmt, ...) · 137 unmodified lines
277281 * panic() is not being callled from OOPS.
278282 */
279283 debug_locks_off();
280− console_flush_on_panic();
284+ console_flush_on_panic(CONSOLE_FLUSH_PENDING);
281285
282286 panic_print_sys_info();
283287
kernel/printk/printk.c+11−1
@@ -2535,10 +2535,11 @@ void console_unblank(void) · 2534 unmodified lines
25352535
25362536 /**
25372537 * console_flush_on_panic - flush console content on panic
2538+ * @mode: flush all messages in buffer or just the pending ones
25382539 *
25392540 * Immediately output all pending messages no matter what.
25402541 */
2541−void console_flush_on_panic(void)
2542+void console_flush_on_panic(enum con_flush_mode mode)
25422543 {
25432544 /*
25442545 * If someone else is holding the console lock, trylock will fail
@@ -2549,6 +2550,15 @@ void console_flush_on_panic(void) · 4 unmodified lines
25492550 */
25502551 console_trylock();
25512552 console_may_schedule = 0;
2553+
2554+ if (mode == CONSOLE_REPLAY_ALL) {
2555+ unsigned long flags;
2556+
2557+ logbuf_lock_irqsave(flags);
2558+ console_seq = log_first_seq;
2559+ console_idx = log_first_idx;
2560+ logbuf_unlock_irqrestore(flags);
2561+ }
25522562 console_unlock();
25532563 }
25542564