Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4241588ybl; Tue, 21 Jan 2020 15:58:30 -0800 (PST) X-Google-Smtp-Source: APXvYqzshg5/hEMBHSrOCh8nE/hM9mzqN+VJsMAV3NoXf7s+g+1XoA3FjQHSCXJupOT2VlQ7JoSR X-Received: by 2002:aca:190b:: with SMTP id l11mr5156627oii.65.1579651110509; Tue, 21 Jan 2020 15:58:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579651110; cv=none; d=google.com; s=arc-20160816; b=he99MCFVxzP6Ri9gNCEvyR01ET5tcGQ5KIIKg8PVgp6N2LBCOL1jSi93TTNS+bMJdg VQ21tZIxnPvzRKAK/xO0BoJXLp9Twsk1K1T0pZsIZYpzE/SJOCVItnUubs8W5S/w4cZ1 FDxlO93h2CEbQO9aSK7xsCMMOvteG9GKGglI0yBvdknSK0y9Hq0UdpZUMbpH3K9km8cM wyjVTRmgA/kPwQGkN6cAvurjQN4tKfld1hY/2evBIerKaExHzrz1YHEt3iPXz1PuMz5b 2cC/EbgoA0T46ZgnvRkIdSWnxBk6Y8PhYqsS9WoTZQbj4HuL9KopAMuD8ACEbAK4whFF BJ5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=PBEmjIx1LWgQerhZIWIJh/hWOTofa1Ac/emQ8/gc3m8=; b=Uohfqztdfy26PIAbvJ6iJ7S38DMR0JFLXDAnXLQjVHd1Dmh7731Vhm8LcFVa3qpJEl ZeTkl1Rm/Sv3AicZrzUl+uFT7PSkBKvaIOXrmiviI9oNhl5TLdLBs3G28nyhHdf5bKQA PQLZVnAQJJWGcaSTJc4we6qtsyylPYxC39yl1/fF5Zo/eKaJIuaUIb09ORT8tM1y/1bB hgr5T18K486d3cxm1ZXVrgFr/GdFIt8+UF5NxWZzeNxVn1a8rUj6jjHqWAB23q6KtN1r q2TSr7n83n9WKzmr+DphswsP6cXgwYc+DqdikdnPTRFgLhP2vTKN2lQYyCG3lJA1XCI2 Q0LQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s3si22273302otr.57.2020.01.21.15.58.18; Tue, 21 Jan 2020 15:58:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727969AbgAUX5Y (ORCPT + 99 others); Tue, 21 Jan 2020 18:57:24 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:36365 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbgAUX5X (ORCPT ); Tue, 21 Jan 2020 18:57:23 -0500 Received: from localhost ([127.0.0.1] helo=vostro.local) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1iu3O9-0006uj-7Y; Wed, 22 Jan 2020 00:56:53 +0100 From: John Ogness To: Eugeniu Rosca Cc: , Peter Zijlstra , Geert Uytterhoeven , Kuninori Morimoto , Andrew Gabbasov , Sanjeev Chugh , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Daniel Wang , Dean Jenkins , Andrew Morton , Linus Torvalds , Greg Kroah-Hartman , Dirk Behme , Alan Cox , Jiri Slaby , Peter Feiner , , Sergey Senozhatsky , Eugeniu Rosca Subject: Re: [RFC PATCH v1 00/25] printk: new implementation References: <20190212143003.48446-1-john.ogness@linutronix.de> <20200120230522.GA23636@lxhi-065.adit-jv.com> Date: Wed, 22 Jan 2020 00:56:48 +0100 In-Reply-To: <20200120230522.GA23636@lxhi-065.adit-jv.com> (Eugeniu Rosca's message of "Tue, 21 Jan 2020 00:05:22 +0100") Message-ID: <87v9p4mkhr.fsf@linutronix.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Eugeniu, On 2020-01-21, Eugeniu Rosca wrote: > This [1] is a fairly old thread, but I only recently stumbled upon it, > while co-investigating below audio distortions [2] on R-Car3 ARM64 > boards, which can be reproduced by stressing [3] the serial console. > > The investigation started a few months ago, when users reported audio > drops during the first seconds of system startup. Only after a few > weeks it became clear (thanks to some people in Cc) that the > distortions were contributed by the above-average serial console load > during the early boot. Once understood, we were able to come up with a > synthetic test [2-3]. > > I thought it would be interesting to share below reproduction matrix, > in order to contrast vanilla to linux-rt-devel [4], as well as to > compare various preemption models. > > | Ser.console Ser.console > | stressed at rest or disabled > -------------------------------------------- > v5.5-rc6 (PREEMPT=y) | distorted clean > v5.4.5-rt3 (PREEMPT=y) | distorted clean > v5.4.5-rt3 (PREEMPT_RT=y) | clean clean > > My feeling is that the results probably do not surprise linux-rt > people. > > My first question is, should there be any improvement in the case of > v5.4.5-rt3 (PREEMPT=y), which I do not sense? I would expect so, based > on the cover letter of this series (pointing out the advantages of the > redesigned printk mechanism). The problem you are reporting is not the problem that the printk rework is trying to solve. In your chart, v5.4.5-rt3 (PREEMPT_RT=y) is the only configuration that is _not_ disabling hardware interrupts during UART activity. I would guess your problem is due to interrupts being disabled for unacceptable lengths of time. You need a low-latency system, so PREEMPT_RT=y _is_ the correct (and only) solution if a verbose serial console is a must. The printk rework focusses on making printk non-interfering by decoupling console printing from printk() callers. However, the console printing itself will still do just as much interrupt disabling as before. That is driver-related, not printk-related. > And the other question is, how would you, generally speaking, tackle > the problem, given that backporting the linux-rt patches is *not* an > option and enabling serial console is a must? The linux-rt patches (which include this printk rework) *are* being ported to mainline now. My recommendation is to continue using the linux-rt patches (with PREEMPT_RT=y) until PREEMPT_RT is available mainline. John Ogness > [1] https://lore.kernel.org/lkml/20190212143003.48446-1-john.ogness@linutronix.de/ > [2] H3ULCB> speaker-test -f24_LE -c2 -t wav -Dplughw:rcarsound -b 4000 > https://vocaroo.com/9NV98mMgdjX > [3] https://github.com/erosca/linux/tree/stress-serial > [4] https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/