mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] printk: do not flush the logbuf into console driver in interrupt
@ 2012-05-17  7:46 Liu, Chuansheng
  2012-05-17  9:31 ` Peter Zijlstra
  0 siblings, 1 reply; 3+ messages in thread
From: Liu, Chuansheng @ 2012-05-17  7:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: peterz, tglx,
	Yanmin Zhang <yanmin_zhang@linux.intel.com>
	(yanmin_zhang@linux.intel.com)

From: liu chuansheng <chuansheng.liu@intel.com>
Subject: [PATCH] printk: do not flush the logbuf into console driver in interrupt

When irq handle tried to call printk, and it also has the chance to obtain the console sem,
then flush the log buf to console driver,but the console driver often give several ms latency
or more when much data in log buf existed, it will delay the irq handle.

The solution is when calling the printk in interrupt, just write the chars into log buf,
and expect other threads to flush it into console driver.

Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>

diff --git a/kernel/printk.c b/kernel/printk.c index b663c2c..99959e1 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -804,7 +804,8 @@ static int console_trylock_for_printk(unsigned int cpu)
                 * the buffer. We need to hold the console semaphore
                 * in order to do this test safely.
                 */
-               if (!can_use_console(cpu)) {
+               if (!can_use_console(cpu) ||
+                       (in_interrupt() && (!oops_in_progress))) {
                        console_locked = 0;
                        wake = 1;
                        retval = 0;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-18  0:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-17  7:46 [PATCH] printk: do not flush the logbuf into console driver in interrupt Liu, Chuansheng
2012-05-17  9:31 ` Peter Zijlstra
2012-05-18  0:16   ` Liu, Chuansheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome