From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752108AbdF3O2q (ORCPT ); Fri, 30 Jun 2017 10:28:46 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:36003 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751649AbdF3O2o (ORCPT ); Fri, 30 Jun 2017 10:28:44 -0400 Date: Fri, 30 Jun 2017 23:28:51 +0900 From: Sergey Senozhatsky To: Steven Rostedt Cc: Sergey Senozhatsky , Petr Mladek , Sergey Senozhatsky , Jan Kara , Andrew Morton , Peter Zijlstra , "Rafael J . Wysocki" , Eric Biederman , Greg Kroah-Hartman , Jiri Slaby , Pavel Machek , Andreas Mohr , Tetsuo Handa , linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCHv3 2/5] printk: introduce printing kernel thread Message-ID: <20170630142851.GF792@jagdpanzerIV.localdomain> References: <20170509082859.854-1-sergey.senozhatsky@gmail.com> <20170509082859.854-3-sergey.senozhatsky@gmail.com> <20170510055935.GA1966@jagdpanzerIV.localdomain> <20170529092906.GD21894@pathway.suse.cz> <20170531072233.GC7672@jagdpanzerIV.localdomain> <20170628121925.GN1538@pathway.suse.cz> <20170629073321.GA475@jagdpanzerIV.localdomain> <20170630115457.GE23069@pathway.suse.cz> <20170630124224.GA792@jagdpanzerIV.localdomain> <20170630093309.5994110a@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170630093309.5994110a@gandalf.local.home> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (06/30/17 09:33), Steven Rostedt wrote: [..] > > "something sometime in the future" is equal to "no one". > > > > we must stay and continue printing. because it gives the right > > answer - "current process and right now. until someone else > > (+printk_kthread) takes over". > > Would it be acceptable to have a user knob that allows for it not to > happen? That is, let the user of the kernel decide if they care about > critical prints or not? If a knob says, "only print X, then offload" > would that be allowed. Of course the default would be "only print ALL > OF IT" to keep the current behavior. I'm sorry, I'm not sure I got your question right (I need some rest probably). I guess the question was, a knob that would determine what happens after current wakes up printk_kthread -- does it stay in console_unlock() and wait for new console_sem owner, printing the messages in the meantime, or goes all in and expects printk_kthread or anything else to lock console_sem at some point and flush the remaining messages. is that correct? we can do this (well, I'm absolutely not in position to say "we can't do this" :) ). I guess the sort of a problem we have now is that we can't guarantee that wake_up() will actually wake_up printk_kthread. but if user requests it, then well... it might be easier to adjust watchdog timeout value ;) just kidding. or may be I misunderstood your question. or... another silly idea... shall we start touching the lockup watchdog per-cpu counters on the CPU that has: a) woken up printk_kthread b) but is still in console_unlock() waiting for the new console_sem owner? ... or we, may be, can add a new sysrq that would flush logbuf messages... the same way as console_flush_on_panic() does. just in case if wake_up didn't work.... or is there already a sysrq for that? -ss > A lot of times the console isn't recorded to debug hard lock ups. I > know most desktops running a GUI do not. When ever my workstation locks > up, and it has no serial, I don't get to see the dmesg at all. In this > situation, I don't care if the prints are offloaded or not. > > -- Steve >