Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757224AbcK3KE7 (ORCPT ); Wed, 30 Nov 2016 05:04:59 -0500 Received: from mx2.suse.de ([195.135.220.15]:40416 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756538AbcK3KBd (ORCPT ); Wed, 30 Nov 2016 05:01:33 -0500 Date: Wed, 30 Nov 2016 11:01:29 +0100 From: Petr Mladek To: Peter Zijlstra Cc: "Paul E. McKenney" , Josh Poimboeuf , Vince Weaver , "linux-kernel@vger.kernel.org" , Ingo Molnar , Arnaldo Carvalho de Melo , "dvyukov@google.com" Subject: Re: perf: fuzzer BUG: KASAN: stack-out-of-bounds in __unwind_start Message-ID: <20161130100129.GD24060@pathway.suse.cz> References: <20161128215411.fkis7bbimjy4v4j7@treble> <20161129004021.GL3924@linux.vnet.ibm.com> <20161129055241.6dy2dt4q4ptazk2s@treble> <20161129124323.GJ3092@twins.programming.kicks-ass.net> <20161129151004.GU3924@linux.vnet.ibm.com> <20161129162920.GF21230@pathway.suse.cz> <20161129171038.GN3092@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161129171038.GN3092@twins.programming.kicks-ass.net> 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 Content-Length: 2758 Lines: 66 On Tue 2016-11-29 18:10:38, Peter Zijlstra wrote: > On Tue, Nov 29, 2016 at 05:29:20PM +0100, Petr Mladek wrote: > > > > > People are very busy polishing the turd we call printk, but from where > > > > I'm sitting its terminally and unfixably broken. > > > > I still hope that we could do better :-) > > How? The console drivers are a complete trainwreck, you simply cannot > build anything sensible ontop of a trainwreck. I am afraid that I will not persuade you but... > And from what I understood from talking to someone (I again forgot who) > at LPC, the whole reason people were poking at this is that the block > layer (or something thereabouts) prints a gazillion lines of crap when > you attach a stupid amount of devices (through FC or other SAN like > things). This is crazy indeed if it happens on a production system. > The way we've 'fixed' that in the scheduler (a fairly long time ago) > when SGI complained about our printks taking too long (because they had > 4096 CPUs), is to simply remove the printks (they're now hidden behind > the sched_debug boot param). This is a solution. But what if you want to enable debugging and the system does not boot because the printing takes too long. > In any case, as long as printk has a globally serialized 'log', it, per > design, will be worse than the console drivers its build upon. And them > being shit precludes the entire stack from being useful. I probably still do not understand all the problems with console drivers. My understanding is that the problem is that they have its own locking and are slow. It means that they are prone to a deadlock and they might block for a long time. In compare, the serialized log buffer has one lock and writing is fast. It means that it suffers "only" from the deadlocks. And we try to address the deadlocks by using the temporary per-CPU buffers in critical situations (NMI, locked sections). Of course, it is useless if you have the messages in a buffer and can't reach them. But we do the best effort to push them to consoles and crash dump. Also it might be very useful to have the log buffer on persistent memory. > It mostly works, most of the time, and that seems to be what Linus > wants, since its really the best we can have given the constraints. But > for debugging, when you have a UART, it totally blows. I believe that the early console is the last resort for debugging some type of bugs. But many other bugs can be debugged with the classic printk(). And there are (production) systems where you cannot (easily) or do not want to use early printk all the time. Another question is the complexity of the printk() code. Especially, the big effort to get "perfect" (non-mixed) output is questionable. Best Regards, Petr