Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6371112ybe; Wed, 18 Sep 2019 02:18:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtTw+pjw8/K/G3u3vG3WdmzlPv6H0tewPSoJ4s1Uy7HXoCHylTzmIhQ77jonUD8pg1jnyw X-Received: by 2002:a50:f09d:: with SMTP id v29mr8952924edl.4.1568798303915; Wed, 18 Sep 2019 02:18:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568798303; cv=none; d=google.com; s=arc-20160816; b=f2s52hX2/lj9UyInC45JZhW3AuFXAgIr8VKUG28Ko8NuQ990jWeo0UN+ktYwkhSLW9 pPiDcDdgCId3k+QW7Cg5AMLBYt5AkQ5C1uALqEusN07sEofuQgtBUIXOC+FowjUEiuhB O3cHVltI7rXTEHxdDHo3+GfeoR7KGlvMMEitFoTNsnqyLSg60d2N6gCxqz62S8fZnlSC u41igQwbIapPgFostZWRsAJnT9hZvdlamVSaNwdkiYh1YCv41JijQyMhRpr3JqmBM9NC +5jT8IJj+WE8CNVBCJXaUbRqRT64QQYlNkmkv0/KE091HWPpSyRJQADyLrsuACMtNdcR nK3A== 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=bd8fyrjBkrMIE42BgT6KJhBHBEc+LIeViGVdHkxnmms=; b=F1oNc/Zjc1PM2X7zMnEqCKAJKl0oc93SDINalagu+L7gwF1kFiR45iQefDwefEK9XE J/pKVwvATnpP4l2ymjBKaDeIWXxX96g1mA05yIGnwFm20ES83bXpItZB4+6+n+l2iZfK OB+eLm2I05DnR5kTpY5qbZdws2vhJ7TQ8Jd4i2GRWF/NxLsuPh0T2g7wYNV/iLE14/r5 6eI1FKWQxbhQDsu49Afc9zv2X4SRlVEsOcW1aeFO/hU0CGW6zcVtajp9qWvEaxrql9oa jPLCD6ryp8BHpCDg6aSwR/bMsmURCopcbG0BMZyI1sxXwtlhBMLxxfgugFiBWMngNPyr kwBw== 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 d58si2913972eda.62.2019.09.18.02.18.01; Wed, 18 Sep 2019 02:18:23 -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 S1729125AbfIRHdN (ORCPT + 99 others); Wed, 18 Sep 2019 03:33:13 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:45063 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725298AbfIRHdN (ORCPT ); Wed, 18 Sep 2019 03:33:13 -0400 Received: from localhost ([127.0.0.1] helo=vostro.local) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1iAUSU-0008LA-Tw; Wed, 18 Sep 2019 09:33:03 +0200 From: John Ogness To: Sergey Senozhatsky Cc: Steven Rostedt , Linus Torvalds , Thomas Gleixner , Peter Zijlstra , Petr Mladek , Andrea Parri , Sergey Senozhatsky , Brendan Higgins , Greg Kroah-Hartman , LKML , Theodore Ts'o , Paul Turner , Daniel Vetter , Prarit Bhargava Subject: Re: printk meeting at LPC References: <20190807222634.1723-1-john.ogness@linutronix.de> <20190904123531.GA2369@hirez.programming.kicks-ass.net> <20190905130513.4fru6yvjx73pjx7p@pathway.suse.cz> <20190905143118.GP2349@hirez.programming.kicks-ass.net> <20190905121101.60c78422@oasis.local.home> <87k1acz5rx.fsf@linutronix.de> <20190918012546.GA12090@jagdpanzerIV> <20190917220849.17a1226a@oasis.local.home> <20190918023654.GB15380@jagdpanzerIV> Date: Wed, 18 Sep 2019 09:33:01 +0200 In-Reply-To: <20190918023654.GB15380@jagdpanzerIV> (Sergey Senozhatsky's message of "Wed, 18 Sep 2019 11:36:54 +0900") Message-ID: <87lfumnjo2.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-09-18, Sergey Senozhatsky wrote: >>>> 2. A kernel thread will be created for each registered console, >>>> each responsible for being the sole printers to their respective >>>> consoles. With this, console printing is _fully_ decoupled from >>>> printk() callers. >>> >>> sysrq over serial? >>> >>> offloading this to kthread may be unreliable. >> >> But we also talked about an "emergency flush" which will not wait for >> the kthreads to finish and just output everything it can find in the >> printk buffers (expecting that the consoles have an "emergency" >> handler. We can add a sysrq to do an emergency flush. The problem with only a flush here is that the sysrq output may not fit in the ringbuffer (ftrace, for example). It probably makes more sense to have a switch to enter/exit "synchronous state", where all atomic consoles are flushed upon enter and all future printk's are synchronous on atomic consoles until exit. I expect sysrq to be the only valid use of "synchronous state" other than oops/panic. Although I suppose PeterZ would like a boot argument to always run the consoles in this state. > I agree that when consoles have ->atomic_write then it surely makes > sense to switch to emergency mode. I like the emergency state > approach, but I'm not sure how it can be completely invisible to the > rest of the system. Quoting John: > > : Unlike oops_in_progress, this state will not be visible to > : anything outside of the printk infrastructure. > > For instance, tty/sysrq must be able to switch printk emergency > on/off. The switch/flush _will_ be visible. But not the state. So, for example, it won't be possible for some random driver to determine if we are in an emergency state. (Well, I don't know if oops_in_progress will really disappear. But at least the printk/console stuff will no longer rely on it.) > We also figured out that some PM (hibernation/suspend/etc.) stages > (very early and/or very late ones) [2] also should have printk in > emergency mode, plus some other parts of the kernel [3]. > > [1] https://lore.kernel.org/lkml/20170815025625.1977-4-sergey.senozhatsky@gmail.com/ > [2] https://lore.kernel.org/lkml/20170815025625.1977-7-sergey.senozhatsky@gmail.com/ > [3] https://lore.kernel.org/lkml/20170815025625.1977-8-sergey.senozhatsky@gmail.com/ Thanks for bringing up that RFC thread again. I haven't looked at it in over a year. I will go through it again to see if there is anything I've overlooked. Particularly the suspend stuff. John Ogness