From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754335AbcIBPQE (ORCPT ); Fri, 2 Sep 2016 11:16:04 -0400 Received: from mx2.suse.de ([195.135.220.15]:43857 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754105AbcIBPQA (ORCPT ); Fri, 2 Sep 2016 11:16:00 -0400 Date: Fri, 2 Sep 2016 17:15:49 +0200 From: Petr Mladek To: Sergey Senozhatsky Cc: Sergey Senozhatsky , Jan Kara , Viresh Kumar , Andrew Morton , Jan Kara , Tejun Heo , Tetsuo Handa , "linux-kernel@vger.kernel.org" , Byungchul Park , vlevenetz@mm-sol.com, Greg Kroah-Hartman Subject: Re: [PATCH v10 1/2] printk: Make printk() completely async Message-ID: <20160902151549.GG4554@pathway.suse.cz> References: <20160820052430.GA695@swordfish> <20160822041520.GA511@swordfish> <20160825210959.GA2273@dhcp128.suse.cz> <20160826015641.GA520@swordfish> <20160830092912.GP4866@pathway.suse.cz> <20160831023134.GA390@swordfish> <20160831093810.GE4554@pathway.suse.cz> <20160831125224.GA572@swordfish> <20160901085844.GW4866@pathway.suse.cz> <20160902075808.GA26230@swordfish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160902075808.GA26230@swordfish> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 2016-09-02 16:58:08, Sergey Senozhatsky wrote: > On (09/01/16 10:58), Petr Mladek wrote: > > On Wed 2016-08-31 21:52:24, Sergey Senozhatsky wrote: > > > a console_unlock() doing > > > wake_up_process(printk_kthread) would make it better. > > > > I am not sure what you mean by this. > > I meant that this thing > > local_irq_save() // or preempt_disable() > ... > if (console_trylock()) > console_unlock(); > ... > local_irq_restore() // or preempt_enable() I see. > can easily lockup the system if console_trylock() was successful and there > are enough messages to print. printk_kthread can't help, because here we > basically enforce the `old' behavior. we have async printk, but not async > console output. tweaking console_unlock() to offload the actual printing loop > to printk_kthread would make the entire console output async: > > static void console_sync_flush_and_unlock(void) > { > for (;;) { > ... > call_console_drivers(); > ... > } > } > > void console_unlock(void) > { > if (!MOTORMOUTH && can_printk_async()) { > up(); > wake_up_process(printk_kthread); > return; > } > console_sync_flush_and_unlock(); > } Something like this would make sense. But I would do it in a separate patch(set). We need to go through all console_unlock() callers and make sure that they are fine with the potential async behavior. I would not complicate the async printk patchset by this. Best Regards, Petr