From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
"K. Y. Srinivasan" <kys@microsoft.com>,
Dexuan Cui <decui@microsoft.com>
Subject: [PATCH] serial: core: prevent softlockups on slow consoles
Date: Mon, 31 Aug 2015 16:34:16 +0200 [thread overview]
Message-ID: <1441031656-17959-1-git-send-email-vkuznets@redhat.com> (raw)
Hyper-V serial port is very slow on multi-vCPU guest, this causes
soflockups on intensive console writes. Touch nmi watchdog after putting
every char on port to avoid the issue for all serial drivers, the overhead
should be small.
This is just a part of the fix: serial8250_console_write() disables irqs
for all its execution time (which on such slow consoles can be dozens of
seconds), it should be possible to observe devices being stuck on this
CPU. We need to find a better way, e.g. do output in batches enabling irqs
in between.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
drivers/tty/serial/serial_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index f368520..cc05785 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -33,7 +33,7 @@
#include <linux/serial.h> /* for serial_state and serial_icounter_struct */
#include <linux/serial_core.h>
#include <linux/delay.h>
-#include <linux/mutex.h>
+#include <linux/nmi.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
@@ -1792,6 +1792,7 @@ void uart_console_write(struct uart_port *port, const char *s,
if (*s == '\n')
putchar(port, '\r');
putchar(port, *s);
+ touch_nmi_watchdog();
}
}
EXPORT_SYMBOL_GPL(uart_console_write);
--
2.4.3
next reply other threads:[~2015-08-31 14:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-31 14:34 Vitaly Kuznetsov [this message]
2015-09-02 14:38 ` Peter Hurley
2015-09-02 16:09 ` Vitaly Kuznetsov
2015-09-04 4:20 ` Greg Kroah-Hartman
2015-09-04 7:19 ` Vitaly Kuznetsov
2015-09-04 10:42 ` Peter Hurley
2015-09-04 16:10 ` Greg Kroah-Hartman
2015-09-06 11:48 ` Dexuan Cui
2015-09-06 11:58 ` KY Srinivasan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1441031656-17959-1-git-send-email-vkuznets@redhat.com \
--to=vkuznets@redhat.com \
--cc=decui@microsoft.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®