Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1218676

Re: [PATCH] serial: core: prevent softlockups on slow consoles

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH] serial: core: prevent softlockups on slow consoles
Date 2015-09-04 06:30 +0200
Message-ID <q4QNs-85W-7@gated-at.bofh.it> (permalink)
References <q3ypA-259-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Aug 31, 2015 at 04:34:16PM +0200, Vitaly Kuznetsov wrote:
> 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();

I don't like this, please narrow this down to the real problem that your
hardware has here, the putchar function should not be this slow.  If it
is, something is wrong.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] serial: core: prevent softlockups on slow consoles Vitaly Kuznetsov <vkuznets@redhat.com> - 2015-08-31 16:40 +0200
  Re: [PATCH] serial: core: prevent softlockups on slow consoles Peter Hurley <peter@hurleysoftware.com> - 2015-09-02 16:40 +0200
    Re: [PATCH] serial: core: prevent softlockups on slow consoles Vitaly Kuznetsov <vkuznets@redhat.com> - 2015-09-02 18:20 +0200
  Re: [PATCH] serial: core: prevent softlockups on slow consoles Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-09-04 06:30 +0200
    Re: [PATCH] serial: core: prevent softlockups on slow consoles Vitaly Kuznetsov <vkuznets@redhat.com> - 2015-09-04 09:20 +0200
      Re: [PATCH] serial: core: prevent softlockups on slow consoles Peter Hurley <peter@hurleysoftware.com> - 2015-09-04 12:50 +0200
      Re: [PATCH] serial: core: prevent softlockups on slow consoles Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-09-04 18:20 +0200
        RE: [PATCH] serial: core: prevent softlockups on slow consoles KY Srinivasan <kys@microsoft.com> - 2015-09-06 14:00 +0200

csiph-web