Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6209116ybe; Tue, 17 Sep 2019 22:58:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFvUZ5rvJGJCEaHdv0s1yty4942wshmcghhyA2cFG2L9w4ZMDdwUvZrwfAeWKmo/+riWa1 X-Received: by 2002:a50:ec84:: with SMTP id e4mr8690458edr.193.1568786294574; Tue, 17 Sep 2019 22:58:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568786294; cv=none; d=google.com; s=arc-20160816; b=q1cBxOaKsCRHPQVLnHR+qmKe6qbrazSCT5ubS07pt/GLQCecNiEo82Fuqic43vjCBf kWlJ/E6yeOJUrJcTrGoCTXam4/a26HopGOyxHqdGYrGYvLx6P+Hgu2NNdgco7QrWZijl UVrA+5i3h8w7qPKnAgLmLhgnlQXrIjx1Icf0V2HZNztVGlE4ByyYZ61Lkc8IWA36fTWU iPFh/tZ4ShdI5Pn1XSZPzRyGfC3TgmLKHFtBzxBWBnEDyjaSwkPk1jwRe6TwexU/0eZi i55gaLt3HA1AW0wg58W/hv8n7ICpeNv9vKzcewbYRGpuVSznQKBLrBcgwqZZ1nT/0Zsz NkvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8wpxxTUuGVsmgpbrkwQXSwnsj5db54LEf/di0DULFjk=; b=DoBsmG8qRhzLukaVRbpfcJmfV2kH2GZOfnL6jzkegP6h+FGsF06NZ2sA/G6lk8wCC+ cOb06hfEkIrMoVyKj728l9tFoMPoLdCtQkgVJp8Wbm5wjOjd3UN79nUBrh7EXYVK8EoG H/BMp0hrEEIqWuVWPrjDRfPBlIkdLispZhr6rBatBUhZ2ivSzud35aTwwJ9B6sJizUm/ fxx6TL4g/eRA3OzNWOoTteYy5kbFFtg1GTplRjQH3E0h6nAgjDCl/QmUS3iz9EnqnQOd WJP7vww/G1BqyHx4I+qT5ikv9zJM7jXQrmQz2vl1+sI+m3yy29kJR0H7k3oVzJi2HlFw mKQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZNr5fPgN; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h51si2652155eda.85.2019.09.17.22.57.51; Tue, 17 Sep 2019 22:58:14 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZNr5fPgN; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727147AbfIRCg7 (ORCPT + 99 others); Tue, 17 Sep 2019 22:36:59 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:45273 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726666AbfIRCg7 (ORCPT ); Tue, 17 Sep 2019 22:36:59 -0400 Received: by mail-pg1-f194.google.com with SMTP id 4so3066413pgm.12 for ; Tue, 17 Sep 2019 19:36:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8wpxxTUuGVsmgpbrkwQXSwnsj5db54LEf/di0DULFjk=; b=ZNr5fPgNdzS2J5NPV+kZEQC//guguQKQWma09goV6KF6vw4ujTy8073g/95XHe9Tn3 xXb1hL8xhE2To2tJiN+GryhRq2jfs8Kv0+crhnIgNAT7nk5sWvypSgAuItdPTEY5skuc S9328xDog+2IWzO+1rkLqsRfvn3P9rglGId9hW3ym8vp9uvVG0D/+E1D7ZmQZHtcTWSC fDCcqSCDZTPXBLafEgjoFeIpWPaTLnsvhPEE1gU5UuPtTWS66ccZ4QJm10gzk+VZomUM QKFZZrP7IZymuwu/72T31zIXPJ6d6mZ23fTg2NvDK+Yr2lNeIEJDapnw2dN1sCW8RBdu SPgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=8wpxxTUuGVsmgpbrkwQXSwnsj5db54LEf/di0DULFjk=; b=Bl78vCfgeYKbTjpmfIC4zTKmDGvTzVH0PyD7nnJpE8UFYe0uMbLCJbC6d0PaSIL04c PJM5lqyJ3kEyKuBV/AtVPEWKAQKw2u/Nou1EoSFdC+tIBZUnz+BMZdWlDa5I7hDzeaQ6 /5Lkpr/b/HcDdUY4eGjxamWF9/xGXIOIqJ6zpXtjGJ9hE8rHp3iPqHzm81+pUuq9Idu8 eO+utLmHFAlz7/2RjKsIhTeM9wQLkJ5SuCGqWEyqkq045xM6kEWVK7hEddvAsGUrJSFK EehHuxoRqAKJ68G/R9nzA+CwxEBByO3LG44nVJ4ZjAPop87eAF5WJWlZrjRytBjIPOav MzxQ== X-Gm-Message-State: APjAAAVnwOD3jpo0RMVwU2eC804OFWFUpAtVGuCDFwSdfQgY7tvvK/me ZXfAktV1+7HGM9cKKLKnjiE= X-Received: by 2002:a62:83cb:: with SMTP id h194mr1676102pfe.66.1568774218716; Tue, 17 Sep 2019 19:36:58 -0700 (PDT) Received: from localhost ([175.223.34.14]) by smtp.gmail.com with ESMTPSA id a29sm6437181pfr.152.2019.09.17.19.36.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 19:36:57 -0700 (PDT) Date: Wed, 18 Sep 2019 11:36:54 +0900 From: Sergey Senozhatsky To: Steven Rostedt Cc: Sergey Senozhatsky , John Ogness , 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 Message-ID: <20190918023654.GB15380@jagdpanzerIV> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190917220849.17a1226a@oasis.local.home> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (09/17/19 22:08), Steven Rostedt wrote: > > On (09/13/19 15:26), John Ogness 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? > > > > What we currently have is hacky, but, as usual, is a "best effort": > > > > >> serial driver IRQ > > > > serial_handle_irq() [console driver] > > uart_handle_sysrq_char() > > handle_sysrq() > > printk() > > call_console_drivers() > > serial_write() [re-enter console driver] > > > > 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. I'm sorry, I wasn't there, so I'm surely is missing on some details. 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. That already means that printk emergency knob should be visible to the rest of the kernel. A long time ago, we had printk_emergency_begin_sync() and printk_emergency_end_sync(), which would define reentrable printk_emergency blocks [1]: printk_emergency_begin_sync(); handle_sysrq(); printk_emergency_end_sync(); 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/ -ss