Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4674366ybl; Wed, 22 Jan 2020 02:35:01 -0800 (PST) X-Google-Smtp-Source: APXvYqzXtrhLu92oGtq0pZoFlgirwzXUOghqb39Ukfi/bamFD7i8p53AmfYo4rukciccLhg3Vqmu X-Received: by 2002:a05:6808:9ba:: with SMTP id e26mr6309138oig.81.1579689301757; Wed, 22 Jan 2020 02:35:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579689301; cv=none; d=google.com; s=arc-20160816; b=cInk/CI0AiPgnlHRGmeTayxy7a6EzCa2eURy9+NzqSTHUvB9jtPZw/pnM9Y9b7lqXM gA3+wCG8beg0tbDQ1ysBtK2wOGvp2dbTpI0x77QD5FNKuHGb/zC/oI3zDymMbaYhLe5g ayfquZZgyViFR5UruX3IiFbCw1BK7frasXcwFhFypOh1UBjnzu73OHLwPPNCKtb91/eC v1UCN39IoIEBU88HJA3vOdczB+B7iwumVLCTeSgaq+qcXbC1bEwV1NGkyv0EYBUKrHEk H7RuAPuT6/HPn7bmSIiUul8nALbXcETzR6ZvOFJznu6cf1Zioq2rCAImt1y/w6kzkvmT j8cA== 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=eypQrQE7SLjoVSLHwelHrmg0i6WBQwWMZs8b1PO+laM=; b=okLDaWgHGetk3BjCyoThqS8qRhgX6CDJQI7rNA1oFFEC2AvviH+feOa4ypG+WpXOGG M4CZeaOuLXCZufdwGWQRLdBjXy/novi+bbyxeDM2D8GlLoO0MJqhe2Juufgk2o4WKl81 OcvxUTxQq9Fhxt6qr8kXDX5oR+od6gpdZCiq1+Dx95FFP2qWd/i4VJ6kTS1WZV+x2vX1 2GuKh43hF3ovSXyvBZKt11rseDpq2V0P2vCQoYsZwYbvli3WWAlhkAGEa8qoPER5V/Ta VdRim0gv6aeQKHrXD/Mg6RbBjClPAzZpi4rtP+yCHiLEzzMycP6zVApejV7QHQsF6PIX dJKw== 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 m3si21602059otf.42.2020.01.22.02.34.49; Wed, 22 Jan 2020 02:35:01 -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 S1729447AbgAVKdn (ORCPT + 99 others); Wed, 22 Jan 2020 05:33:43 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:37255 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728931AbgAVKdn (ORCPT ); Wed, 22 Jan 2020 05:33:43 -0500 Received: from localhost ([127.0.0.1] helo=vostro.local) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1iuDJy-00005h-JH; Wed, 22 Jan 2020 11:33:14 +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> <87v9p4mkhr.fsf@linutronix.de> <20200122023422.GA926@lxhi-065.adit-jv.com> Date: Wed, 22 Jan 2020 11:33:12 +0100 In-Reply-To: <20200122023422.GA926@lxhi-065.adit-jv.com> (Eugeniu Rosca's message of "Wed, 22 Jan 2020 03:34:22 +0100") Message-ID: <87zhefu6fr.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 On 2020-01-22, Eugeniu Rosca wrote: > So, what's specific to R-Car3, based on my testing, is that the issue > can only be reproduced if the printk storm originates on CPU0 (it does > not matter if from interrupt or task context, both have been > tested). If the printk storm is initiated on any other CPU (there are > 7 secondary ones on R-Car H3), there is no regression in the audio > quality/latency. > > I cannot fully explain this empirical observation, but it directs my > mind to the following workaround, for which I have a PoC: > - employ vprintk_safe() any time CPU0 is the owner/caller of printk > - tie CPU0-private printk internal IRQ workers to another CPU > > The above makes sure nothing is printed to the serial console on > behalf of CPU0. I don't even hope this to be accepted by community, > but can you please share your opinion the idea itself is sane? It is a problem-specific hack. You will need to be certain that CPU1-7 will never have problems with console printing storms. Be aware that vprintk_safe() is not particularly reliable in many crash scenarios. If seeing oops output on the console is important, this can be a risky hack. Also, be aware that it has its own config option for the safe buffer size: PRINTK_SAFE_LOG_BUF_SHIFT >> 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. > > I didn't dive into the internals of this series, but decoupling the > execution context of the serial driver from the execution context of > the printk callers sounds very good to me (this is what i try to > achieve via vanilla vprintk_safe). I wonder if it's easier to remove > CPU0 from equation with this series applied. Yes, it would be quite easy. The console printers run as dedicated kthreads. It is only a matter of setting the CPU affinity for the related kthread. >> 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. > > If there is any roadmap publicly available, I would appreciate a > reference. I am only aware of the quilt "series" file [0] that is roughly documenting the status of the effort. John Ogness [0] https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/tree/patches/series?h=linux-5.4.y-rt-patches