From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752224AbdGDGxq (ORCPT ); Tue, 4 Jul 2017 02:53:46 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34592 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751979AbdGDGxo (ORCPT ); Tue, 4 Jul 2017 02:53:44 -0400 Date: Tue, 4 Jul 2017 15:53:51 +0900 From: Sergey Senozhatsky To: Sergey Senozhatsky Cc: Steven Rostedt , 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: <20170704065351.GA437@jagdpanzerIV.localdomain> References: <20170529092906.GD21894@pathway.suse.cz> <20170531072233.GC7672@jagdpanzerIV.localdomain> <20170628121925.GN1538@pathway.suse.cz> <20170629073321.GA475@jagdpanzerIV.localdomain> <20170630070131.GA474@jagdpanzerIV.localdomain> <20170630131610.GT1538@pathway.suse.cz> <20170630133844.GD792@jagdpanzerIV.localdomain> <20170703111130.GA836@jagdpanzerIV.localdomain> <20170703153414.65ab12e3@gandalf.local.home> <20170704052606.GC3013@jagdpanzerIV.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170704052606.GC3013@jagdpanzerIV.localdomain> 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 (07/04/17 14:26), Sergey Senozhatsky wrote: [..] > not sure if we can properly throttle printk in all of the cases. > we know that console_sem is locked, but we don't know what for. > is CPU that owns the console_sem is now in console_unlock() or > somewhere in fbcon, or anywhere else. we probably need not to > throttle printk() if we know that console_sem is already locked > by this_cpu and we simply call printk either from IRQ that > preempted console_unlock() on this_cpu or recursive printk from > console_unlock()... and so on. which is hard to do, given that console_unlock() can schedule with console_sem locked. so CPU number won't do the trick. unless we will forbid preemption in console_unlock()... we sort of need to do it. -ss