Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2166146imc; Tue, 12 Mar 2019 08:17:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxO5scnltwkp78ReASfTR5HoHiq4+U/OHnRCYWDRsrEqmC17AgPM8dbQWv3svotAYX10sO8 X-Received: by 2002:a62:204f:: with SMTP id g76mr40288752pfg.100.1552403849457; Tue, 12 Mar 2019 08:17:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552403849; cv=none; d=google.com; s=arc-20160816; b=txWA5IgyXN270D7gonPouDUKNZRgl8B0HtSrJeqNrwSO1D/Tvx58+DPilchyVBmGRW 8/d+0w+lkwvPWTN0DKMa8Wxa36G7f2fmmf/Ywq8trat4PNnhwJsNhbxnMX5ub3xa5Hv/ TUtRfXOcn/8ye4x0yEtU+UdI52gAW8rKFe4QBOo5ejzjzIt1o1mo+nqxesOHfbsUxmpD leDSAGy4sAm/Uq8I15UdWkF5D+G8tAYx/HB9vklImjmmrtJAYPKXz7QBg0TwTjkHHboD TMI+oL1ULlAl7v1TfM44JuW8EcdCsk8s4j+91RV5Rb6hLzUkYUFk3HvVX6ecepYjG8s5 fChw== 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=8fxJr9bt5JiO1SCbAIBxdfsy3qegEwFf0IPbBP2q7oI=; b=bJaR1K542dgAhdmlVvHAG6oDGO+GIoABeq6MR9pELra6zhNdvCui/cwJLoYge4B7DH Y74F8bbAMf+BrGFBXFzfqlhJF/9ee9YeKhkQtvcH+iFMZI4Lg4syJIWajZIefW1IJGtM 6QFp9AoP866VE1x9zkAHUjL5z5gl1pIJe9Gury4QBlWCWxggJPrw+OlFytrHPTLVmmgy 93mqYK79WP2NLCSpyEvSJGr9/VGgB0wcYCibmICDyz8o304O3/Dczru2dIcXGAgEEHF7 HoPe0A7hj9pUZf8H49wpZvFXZxAZOIInBaMJNv59QwxMz3f886wUx/QHfouchBx0o15Q OVMg== 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 t16si1141822pgu.51.2019.03.12.08.17.11; Tue, 12 Mar 2019 08:17:29 -0700 (PDT) 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 S1726921AbfCLPQJ (ORCPT + 99 others); Tue, 12 Mar 2019 11:16:09 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:44407 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbfCLPQJ (ORCPT ); Tue, 12 Mar 2019 11:16:09 -0400 Received: from localhost ([127.0.0.1] helo=vostro.local) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1h3j8H-0005eZ-0I; Tue, 12 Mar 2019 16:15:57 +0100 From: John Ogness To: Petr Mladek Cc: Sergey Senozhatsky , linux-kernel@vger.kernel.org, Peter Zijlstra , Steven Rostedt , Daniel Wang , Andrew Morton , Linus Torvalds , Greg Kroah-Hartman , Alan Cox , Jiri Slaby , Peter Feiner , linux-serial@vger.kernel.org, Sergey Senozhatsky , Sebastian Siewior Subject: Re: [RFC PATCH v1 00/25] printk: new implementation References: <20190212143003.48446-1-john.ogness@linutronix.de> <20190213025520.GA5803@jagdpanzerIV> <874l9721hf.fsf@linutronix.de> <20190304052335.GA6648@jagdpanzerIV> <87lg1rggcz.fsf@linutronix.de> <20190311105411.GA368@jagdpanzerIV> <20190312123857.juatd6fwtfmqajze@pathway.suse.cz> Date: Tue, 12 Mar 2019 16:15:55 +0100 In-Reply-To: <20190312123857.juatd6fwtfmqajze@pathway.suse.cz> (Petr Mladek's message of "Tue, 12 Mar 2019 13:38:57 +0100") Message-ID: <874l8815uc.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 2019-03-12, Petr Mladek wrote: > Per-console kthread sounds interesting but there is the problem with > reliability. I mean that kthread need not get scheduled. > > Some of these problems might get solved by the per-console loglevel > patchset. > > Sigh, any feature might be useful in some situation. But we always > have to consider the cost and the gain. I wonder how common is > to actively use two consoles at the same time and what would > be the motivation. The following is from the linux-serial mailing list: "Re: Serial console is causing system lock-up" [0] I'm responding to it here because it really belongs in this thread. On 2019-03-12, Petr Mladek wrote: > On Tue 2019-03-12 09:17:49, John Ogness wrote: >> The current printk implementation is handling all console printing as >> best effort. Trying hard enough to dramatically affect the system, but >> not trying hard enough to guarantee success. > > I agree that direct output is more reliable. It might be very useful > for debugging some types of problems. The question is if it is worth > the cost (code complexity, serializing CPUs == slowing down the > entire system). > > But it is is possible that a reasonable offloading (in the direction > of last Sergey's approach) might be a better deal. > > > I suggest the following way forward (separate patchsets): > > 1. Replace log buffer (least controversial thing) Yes. I will post a series that only implements the ringbuffer using your simplified API. That will be enough to remove printk_safe and actually does most of the work of updating devkmsg, kmsg_dump, and syslog. > 2. Reliable offload to kthread (would be useful anyway) Yes. I would like to implement per-console kthreads for this series. I think the advantages are obvious. For PREEMPT_RT the offloading will need to be always active. (PREEMPT_RT cannot call the console->write() from atomic contexts.) But I think this would be acceptable at first. It would certainly be better than what PREEMPT_RT is doing now. > 3. Atomic consoles (a lot of tricky code, might not be > worth the effort) I think this will be necessary. PREEMPT_RT cannot support reliable emergency console messages without it. And for kernel developers this is also very helpful. People like PeterZ are using their own patches because the mainline kernel is not providing this functionality. The decision about _when_ to use it is still in the air. But I guess we'll worry about that when we get that far. There's enough to do until then. > Could we agree on this? I think this is a sane path forward. Thank you for providing some direction here. John Ogness [0] https://marc.info/?l=linux-serial&m=155239250721543