From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932389AbcIFHQT (ORCPT ); Tue, 6 Sep 2016 03:16:19 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34695 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932155AbcIFHQS (ORCPT ); Tue, 6 Sep 2016 03:16:18 -0400 Date: Tue, 6 Sep 2016 16:16:27 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Sergey Senozhatsky , 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: <20160906071626.GA495@swordfish> References: <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> <20160902151549.GG4554@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160902151549.GG4554@pathway.suse.cz> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On (09/02/16 17:15), Petr Mladek wrote: [..] > > 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. sure. just added one more item to the list. -ss