Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3672648imc; Thu, 14 Mar 2019 02:36:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzH8bC7mnfMs2jSoCcOzucmYezuSMkMcntPk0t+KW908MQFX0Zd5SbGjECJoGtltl3PRA/i X-Received: by 2002:a17:902:b687:: with SMTP id c7mr3177087pls.270.1552556175728; Thu, 14 Mar 2019 02:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552556175; cv=none; d=google.com; s=arc-20160816; b=dnqFSRrE1q58x6peOEqqsPoM0YmuFvBply0NW1Cvz3cqVdwkY0uTaiwZCJWw1X8W9w Vl2mU0ws09NNIW7JwCSr7SRoXyXCr6U8LWQ0A4e5c5fQu6UqcIjGaKIE5VMIrcVG2fcs 1RIRUl4+tKzP1G7z2yTmT/js7QtmIv0iLEKkOIukaCsS78n1itxm8y9MvbW7hxhjaJlV jOWT8dalGO9f5dAoXK+Du3pCTt9NFeksM0s9QNgW+BiZG8fAnwt9meZAcOpYhkPSu86m ti0PlXt+zLgXiIPad/L3yFus9/1q8CatezFr5DfQWMd45BHZWslpPY88Degg6Xg5rscE gG7A== 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=c3RBK3lkhj7UPcX0MpudH4Dmx8pRazlbOocDf8x6R7g=; b=m8fAWmoAp776/kG2p7Uv3e5PgJxredFWvWvAXlexnQfXO77oL1tVP0w7odJSKS14+m 5e129mkYDvMtUJ5DXfDAry+Q0IKwqWUv6SruZnckeN70LBs/jGkPoU0PHeqHg+tbpRvY cPvl+/lrVCRlpT3ePJuqN3FimfQPRK5tDmd052Sd1uob32wUkx0upbYwssPdPp4u2nqn sVKDm0o5cdZT6ura8KKbB+6fAIIf94rdXLioV2N477CRBuxl9CVBeI1Tc1X3LZr24V6W VaK2DpdCStqgO0oqMTW0iU/qAYmozRxCpEzvb//ZtGq9a5Xa61L+co23gWaLxk2cWBz6 j1Ww== 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 t13si12790336pfa.98.2019.03.14.02.36.00; Thu, 14 Mar 2019 02:36:15 -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 S1727048AbfCNJfX (ORCPT + 99 others); Thu, 14 Mar 2019 05:35:23 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:49901 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726539AbfCNJfW (ORCPT ); Thu, 14 Mar 2019 05:35:22 -0400 Received: from localhost ([127.0.0.1] helo=vostro.local) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1h4Mlb-0007BC-6M; Thu, 14 Mar 2019 10:35:11 +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> <874l8815uc.fsf@linutronix.de> <20190314091434.ci26htgagjx6mk4k@pathway.suse.cz> Date: Thu, 14 Mar 2019 10:35:02 +0100 In-Reply-To: <20190314091434.ci26htgagjx6mk4k@pathway.suse.cz> (Petr Mladek's message of "Thu, 14 Mar 2019 10:14:34 +0100") Message-ID: <87y35hn6ih.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-14, Petr Mladek wrote: >>> 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. > > Great. I just wonder if it is going to be fully lockless or > still using the prb_lock. I could understand the a fully lockless > solution will be much more complicated. But I think that it would > make a lot of things easier in the long run. Especially it might > help to avoid the big-kernel-lock-like approach. I will re-visit my lockless implementation and see if I can minimize complexity. We have since identified a couple other negative affects of the prb_lock for PREEMPT_RT relating to CPU isolated setups. So the lockless version is starting to look more attractive from a PREEMPT_RT perspective as well. >>> 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. > > I would personally start with one kthread. I am afraid that > the discussion about it will be complicated enough. We could > always make it more complicated later. > > I understand the immediate offloading might be necessary for > PREEMPT_RT. But a more conservative approach is needed for > non-rt kernels. > > Well, if there won't be a big difference in the complexity > between one and more threads then we could mix it. But > I personally see this a two steps that are better be done > separately. I will create the series in a way that a complete solution with 1 kthread exists and all following patches in the series add per-console kthreads. Then we have a clean cut if we decide we only want the first part of the series. >>> 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. > > I am sure that there are situations where the direct output > to atomic consoles would help with debugging. PeteZ and Steven > are using their own patches for a reason. > > Let's see how the code is complicated and how many consoles > might get supported a reasonable way. Agreed. I will post each of the above series as RFCv2 because I expect we still need some discussion. Especially if I post the fully lockless version of the ringbuffer. I have taken a *lot* of notes about things that need changing during this thread. I think a lot of great feedback has come out of this RFC. Thank you to everyone that responded (publicly and privately)! I'll need several weeks before the RFCv2 for the ringbuffer is ready. John Ogness