From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756105AbdDMFuu (ORCPT ); Thu, 13 Apr 2017 01:50:50 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:34553 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751491AbdDMFuq (ORCPT ); Thu, 13 Apr 2017 01:50:46 -0400 Date: Thu, 13 Apr 2017 14:50:47 +0900 From: Sergey Senozhatsky To: Petr Mladek , Pavel Machek Cc: Jan Kara , "Eric W. Biederman" , Ye Xiaolong , Steven Rostedt , Andrew Morton , Linus Torvalds , Peter Zijlstra , "Rafael J . Wysocki" , Greg Kroah-Hartman , Jiri Slaby , Len Brown , linux-kernel@vger.kernel.org, Sergey Senozhatsky , Sergey Senozhatsky Subject: Re: [printk] fbc14616f4: BUG:kernel_reboot-without-warning_in_test_stage Message-ID: <20170413055047.GB13708@jagdpanzerIV.localdomain> References: <20170407074634.GB1091@jagdpanzerIV.localdomain> <20170407081449.GA12859@amd> <20170407121021.GA379@jagdpanzerIV.localdomain> <20170407124455.GC4756@amd> <20170407151306.GA384@tigerII.localdomain> <20170409101230.GB27363@amd> <20170410045339.GB2793@jagdpanzerIV.localdomain> <20170410184858.GA24226@amd> <20170411014635.GA3836@jagdpanzerIV.localdomain> <20170411161953.GA447@tigerII.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170411161953.GA447@tigerII.localdomain> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (04/12/17 01:19), Sergey Senozhatsky wrote: [..] > it does offloading after X printed lines by the same process. > if we reschedule, then the counter resets. which is probably OK, > we don't really want any process, except for printk_kthread, to > stay in console_unlock() forever. may be this can be changed. we don't want even printk_kthread to keep console_sem locked for too long, because other process that might want to lock console_sem have to sleep in TASK_UNINTERRUPTIBLE as long as printing thread has pending messages to print. so may be the rule can be "every process prints up to `atomic_print_limit' lines and then offloads printing - wake_up()s printk_kthread and up()s console_sem". some other process (printk_kthread or a process from console_sem wait list, let them compete for console_sem) will eventually down() console_sem and print the next `atomic_print_limit' lines, while current process will have a chance to return from console_unlock() and do something else. [..] > the next question will be -- do we even need printk_emergency_begin/end > or we can leave without it. what I meant here -- drop sysrq and kexec printk_emergency_begin/end patches, but keep printk_emergency_begin/end API and do printk_emergency_begin/end in console_suspend()/resume(). PM already calls console_suspend()/resume(). something like that... -ss