From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755017AbbIBOia (ORCPT ); Wed, 2 Sep 2015 10:38:30 -0400 Received: from mail-qk0-f180.google.com ([209.85.220.180]:36386 "EHLO mail-qk0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754788AbbIBOiZ (ORCPT ); Wed, 2 Sep 2015 10:38:25 -0400 Subject: Re: [PATCH] serial: core: prevent softlockups on slow consoles To: Vitaly Kuznetsov , Greg Kroah-Hartman References: <1441031656-17959-1-git-send-email-vkuznets@redhat.com> Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "K. Y. Srinivasan" , Dexuan Cui From: Peter Hurley Message-ID: <55E709DD.1070709@hurleysoftware.com> Date: Wed, 2 Sep 2015 10:38:21 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1441031656-17959-1-git-send-email-vkuznets@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vitaly, On 08/31/2015 10:34 AM, Vitaly Kuznetsov wrote: > Hyper-V serial port is very slow on multi-vCPU guest How slow and why? > 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. Once per message should be sufficient. Although I have no objection to adding this to uart_console_write() for all serial drivers, please remove it from drivers that already do this. > This is just a part of the fix: serial8250_console_write() disables irqs > for all its execution time Interrupts are disabled by printk()/console_unlock() right now anyway; very thorny problem to fix with lots of complications. Regards, Peter Hurley > (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 > --- > 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 /* for serial_state and serial_icounter_struct */ > #include > #include > -#include Why isn't this required anymore? > +#include > > #include > #include > @@ -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); >