[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170329092511.3958-7-sergey.senozhatsky@gmail.com>
Date: Wed, 29 Mar 2017 18:25:09 +0900
From: Sergey Senozhatsky <sergey.senozhatsky@...il.com>
To: Steven Rostedt <rostedt@...dmis.org>,
Petr Mladek <pmladek@...e.com>
Cc: Jan Kara <jack@...e.cz>, Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
"Rafael J . Wysocki" <rjw@...ysocki.net>,
Eric Biederman <ebiederm@...ssion.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jslaby@...e.com>, Pavel Machek <pavel@....cz>,
Len Brown <len.brown@...el.com>, linux-kernel@...r.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>
Subject: [RFC][PATCHv2 6/8] kexec: switch to printk.emergency mode in unsafe places
Switch to printk emergency mode in kernel_kexec(), this
lets us to immediately flush pending kernel message to
the console and to avoid potentially unsafe calls into
the scheduler.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@...il.com>
---
kernel/kexec_core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index bfe62d5b3872..5684ba36ec15 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -1496,6 +1496,8 @@ int kernel_kexec(void)
goto Unlock;
}
+ printk_emergency_begin();
+
#ifdef CONFIG_KEXEC_JUMP
if (kexec_image->preserve_context) {
lock_system_sleep();
@@ -1565,6 +1567,8 @@ int kernel_kexec(void)
}
#endif
+ printk_emergency_end();
+
Unlock:
mutex_unlock(&kexec_mutex);
return error;
--
2.12.2
Powered by blists - more mailing lists