Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4198813pxb; Tue, 25 Jan 2022 05:39:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJzyykhS1NYeSgacTNFEMbvVwU+f3W8Ujv/IK75qKvLd1Gyw4lHflHsPR+Akv0gUK6BFPKIW X-Received: by 2002:a63:8f09:: with SMTP id n9mr15322435pgd.38.1643117968583; Tue, 25 Jan 2022 05:39:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643117968; cv=none; d=google.com; s=arc-20160816; b=j0yW9LA2PdG6b3b95rX+fSd0O3r7HNsH7fCndSj6cW84ZwwNcZXV7H2D8tRjp8ti2Z TK1He4mfF6OnK9HFowfbBPvu98o8NLGDiwQ6HtlbO22ePf0OMKCpsn49aynBhKSuLryL HnuZg/+p2SL8pQA29iVIV7RCJxub5G5//UJ4g0MJW7Q+8mxpbsUgmK2FEGjBK0WMy9uw 8ET/lj11HzRMrOS94F+TBIxeh7Vutd/5u89Anehc461l5+U7FuoAkcBfVOno5aiADyWb hBIKFPB6pfhdQ5AqqaG13xd+bM8/9Fdu09jyBxvGS6OxQLIsCX5y+RKqDsW7bXM2DfT6 qiLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nJhnuBJT5F0H3Gr8RQOXggRIBgFvqfWPyWm4ECyZkUw=; b=hMFjwOOJJJyGYS+iU5iGz+7gBGXk3T836gzhOv/0cER7ItI+w4IZr5uJ6016Vi+NKa TDoe0L6nUMZYrCnaRZYo/4kqWJXbNyKCWnx16tAjJihUNPlYiLIlwWWqyxAFXlUkKbGZ QlfjL1QMOW6UxjHH1xsbO2yGsY1CXjaC4Qt/gIaDR6AOINKOcmr4pokAhkaZtbKrZrQr bCoWp0kF3OSTWO8qCEF+2rDbC9/gyeuwhdUi3XHPpHY5NFYS40pjZITwvkbdI5Ew5OtZ cdQksxP0qDbFxi/TjZR8scIc3w4S4k+AVCHkCTYxw9E33AlLvmGBvUJArdvEvsX3wicX JURQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RmjJs3gc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d21si18765460pfv.81.2022.01.25.05.39.16; Tue, 25 Jan 2022 05:39:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RmjJs3gc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1456539AbiAYJQo (ORCPT + 99 others); Tue, 25 Jan 2022 04:16:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1455640AbiAYJFz (ORCPT ); Tue, 25 Jan 2022 04:05:55 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64C6CC061214; Tue, 25 Jan 2022 00:50:18 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 02AA2613F5; Tue, 25 Jan 2022 08:50:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC098C340E0; Tue, 25 Jan 2022 08:50:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643100617; bh=oxSIri0DeRSQQ3KdpLeQU8/o5kCnSJfA0DeyhNCV32U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RmjJs3gckKBAckVu9AawRxpZd2S4Xg7e1H4AOOrR1GrHWXwPrrQjwAau8JCet/5vq zAwWDwe7WgzsAoQsJ6TTKCLCFJrxX9uzKg1yAOR4hFm+BOU0PIVIZTEWaqSUdAfoLo 0ZTr5VjbIvjXF1kc1fNR70sacBx9tewG8pi5r4mA= Date: Tue, 25 Jan 2022 09:50:14 +0100 From: Greg Kroah-Hartman To: Jon Hunter Cc: wander@redhat.com, Jiri Slaby , "Maciej W. Rozycki" , Johan Hovold , Andrew Jeffery , "open list:SERIAL DRIVERS" , open list , "linux-tegra@vger.kernel.org" , Andy Shevchenko Subject: Re: [PATCH] tty: serial: Use fifo in 8250 console driver Message-ID: References: <20211029201402.428284-1-wander@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 25, 2022 at 08:39:24AM +0000, Jon Hunter wrote: > > On 29/10/2021 21:14, wander@redhat.com wrote: > > From: Wander Lairson Costa > > > > Note: I am using a small test app + driver located at [0] for the > > problem description. serco is a driver whose write function dispatches > > to the serial controller. sertest is a user-mode app that writes n bytes > > to the serial console using the serco driver. > > > > While investigating a bug in the RHEL kernel, I noticed that the serial > > console throughput is way below the configured speed of 115200 bps in > > a HP Proliant DL380 Gen9. I was expecting something above 10KB/s, but > > I got 2.5KB/s. > > > > $ time ./sertest -n 2500 /tmp/serco > > > > real 0m0.997s > > user 0m0.000s > > sys 0m0.997s > > > > With the help of the function tracer, I then noticed the serial > > controller was taking around 410us seconds to dispatch one single byte: > > > > $ trace-cmd record -p function_graph -g serial8250_console_write \ > > ./sertest -n 1 /tmp/serco > > > > $ trace-cmd report > > > > | serial8250_console_write() { > > 0.384 us | _raw_spin_lock_irqsave(); > > 1.836 us | io_serial_in(); > > 1.667 us | io_serial_out(); > > | uart_console_write() { > > | serial8250_console_putchar() { > > | wait_for_xmitr() { > > 1.870 us | io_serial_in(); > > 2.238 us | } > > 1.737 us | io_serial_out(); > > 4.318 us | } > > 4.675 us | } > > | wait_for_xmitr() { > > 1.635 us | io_serial_in(); > > | __const_udelay() { > > 1.125 us | delay_tsc(); > > 1.429 us | } > > ... > > ... > > ... > > 1.683 us | io_serial_in(); > > | __const_udelay() { > > 1.248 us | delay_tsc(); > > 1.486 us | } > > 1.671 us | io_serial_in(); > > 411.342 us | } > > > > In another machine, I measured a throughput of 11.5KB/s, with the serial > > controller taking between 80-90us to send each byte. That matches the > > expected throughput for a configuration of 115200 bps. > > > > This patch changes the serial8250_console_write to use the 16550 fifo > > if available. In my benchmarks I got around 25% improvement in the slow > > machine, and no performance penalty in the fast machine. > > > > Signed-off-by: Wander Lairson Costa > > > On the current mainline and -next branches, I have noticed that the > serial output on many of our Tegra boards is corrupted and so > parsing the serial output is failing. > > Before this change the serial console would appear as follows ... > > [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd071] > [ 0.000000] Linux version 5.16.0-rc6-00091-gadbfddc757ae (jonathanh@jonathanh-vm-01) (aarch64-linux-gnu-gcc (Linaro GCC 6.4-2017.08) 6.4.1 20170707, GNU ld (Linaro_Binutils-2017.08) 2.27.0.20161019) #15 SMP PREEMPT Tue Jan 25 00:15:25 PST 2022 > [ 0.000000] Machine model: NVIDIA Jetson TX1 Developer Kit > > And now I see ... > > [ 0.000000] Booting Linux on physicalfd071] > [ 0.000000] Linux version 5.16.0-rc6-athanh@j-linux-g017.08) Linaro_B20161019n 25 00:[ 0.000000] Machine model: NVIDIA Jet[ 0.000000] efi: UEFI not found. > [ 0.000000] NUMA: No NUMA configurati[ 0.000000] NUMA: Faking a node at [m00000001[ 0.000000] NUMA: NODE_DATA [mem 0x17[ 0.000000] Zone ranges: > > Bisecting is pointing to this commit. Let me know if there are any > tests I can run. Otherwise we may need to disable this at least > for Tegra. Ick. Does this uart have any other quirks assigned to it that are somehow not getting assigned here? thanks, greg k-h