From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752007AbdI1QRj (ORCPT ); Thu, 28 Sep 2017 12:17:39 -0400 Received: from merlin.infradead.org ([205.233.59.134]:59678 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751800AbdI1QRg (ORCPT ); Thu, 28 Sep 2017 12:17:36 -0400 Date: Thu, 28 Sep 2017 18:17:30 +0200 From: Peter Zijlstra To: Sergey Senozhatsky Cc: pmladek@suse.com, linux-kernel@vger.kernel.org, rostedt@goodmis.org, mingo@kernel.org, tglx@linutronix.de Subject: Re: [PATCH 0/3] printk: Add force_early_printk boot param Message-ID: <20170928161730.svyq4db2wimmwv55@hirez.programming.kicks-ass.net> References: <20170928121823.430053219@infradead.org> <20170928160230.GA606@tigerII.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170928160230.GA606@tigerII.localdomain> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 29, 2017 at 01:02:30AM +0900, Sergey Senozhatsky wrote: > but what's up with that scheduler thing I keep hearing about, must be > something new, can I disable it in kconfig? it seems to be conflicting > with CONFIG_PRINTK. Its not new, its been there for a very long time :-) The problem is that the scheduler has WARN()s in, those tend to tickle printk(). Printk() on its own has this console semaphore that tends to want to schedule. Console drivers have things like wakeups, which tend to not work when you're already holding scheduler locks etc.. Its one big giant mess.. Since you removed that lockdep_off() from printk() lockdep now sees and complains, which again hits printk(), recursion FTW! Similarly, since there's a metric ton of locks all over printk() and console driver code, printk() doesn't work well from NMI context. And the taken approach to buffering and then printing later has issues if there is no later. Both problems are solved by using early_printk which has lockless drivers (x86 early_serial_console is the one I use) and avoids all problems that way. Its bullet proof console output. Always works. Its been very good to me. (it of course doesn't help that I work on the scheduler and perf, the latter of which does lots of cruft in NMI context. So I tend to run into the very worst possible situations more than most other people)