From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933852AbdDGMpg (ORCPT ); Fri, 7 Apr 2017 08:45:36 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:32902 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933443AbdDGMo6 (ORCPT ); Fri, 7 Apr 2017 08:44:58 -0400 Date: Fri, 7 Apr 2017 14:44:55 +0200 From: Pavel Machek To: Sergey Senozhatsky Cc: Jan Kara , "Eric W. Biederman" , Sergey Senozhatsky , Ye Xiaolong , Steven Rostedt , Petr Mladek , Andrew Morton , Linus Torvalds , Peter Zijlstra , "Rafael J . Wysocki" , Greg Kroah-Hartman , Jiri Slaby , Len Brown , linux-kernel@vger.kernel.org, lkp@01.org Subject: Re: [printk] fbc14616f4: BUG:kernel_reboot-without-warning_in_test_stage Message-ID: <20170407124455.GC4756@amd> References: <20170331063913.GE20961@yexl-desktop> <20170331144730.GA10578@tigerII.localdomain> <87a881v52o.fsf@xmission.com> <20170403093152.GB15168@quack2.suse.cz> <20170406173306.GD10363@amd> <20170407044334.GA487@jagdpanzerIV.localdomain> <20170407071558.GA11792@amd> <20170407074634.GB1091@jagdpanzerIV.localdomain> <20170407081449.GA12859@amd> <20170407121021.GA379@jagdpanzerIV.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FsscpQKzF/jJk6ya" Content-Disposition: inline In-Reply-To: <20170407121021.GA379@jagdpanzerIV.localdomain> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --FsscpQKzF/jJk6ya Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri 2017-04-07 21:10:21, Sergey Senozhatsky wrote: > On (04/07/17 10:14), Pavel Machek wrote: > [..] > > Well. This is what we had for 20 years. >=20 > I guess it's not just me who is a bit unhappy with printk. ask > Peter Zijlstra what's the first word that comes into his mind > when we reads "printk" :) Well, still we should make sure we are improving. > [..] > > I believe "spend at most 2 seconds in printk(), then print a warning > > and offload" is a solution closer to what we had before. >=20 > a warning here can be very noisy. Well, on normally-configured it should be ok. We don't commonly see printk problems... If it is too noisy, perhaps we should increase from 2 seconds, but I don't think it will be problem. > it's quite common that serial console (`console_seq') is a bit behind > the logbuf head (`log_next_seq'). because log_store() can be much faster > that call into console drivers. >=20 > another case is that printk() !=3D console_unlock(). console_sem can be > locked by VT, TTY, fbdev, (not to mention that some other CPU might be > doing printing), etc. etc. all printk()-s in the meantime will just > log_store() messages, so we can have a bunch on pending messsges in > logbuf, it's normal. the CPU that owns the console_sem will print all > those pending messages from console_unlock() path. the distance between > `log_next_seq' and `console_seq' can be much bigger than 2 seconds or > 240/320/etc chars. so wrong offloading can leave with nothing valuable > in the serial output, even if we would defer it. >=20 > well, I'm not arguing. just saying that it's not so easy to do everything > right here. > Well, I have to agree here. This is 20 years worth of mess :-(. > what we have been thinking about is something like printk-stall detection. > we probably (there are some if-s) can detect in printk() that offloading > does not work and we must automatically switch to printk_emergency mode. > that, in theory, can relax our dependency on printk_emergency_begin/end > being in the right place at the right time. need to think more about it. So... I don't really like the begin/end interface. I would rather have printk_emergency(KERN_ ...). Second... I don't think "stuck detector" is that helpful. What I usually seen was some rather innocent kernel message followed by hard-lock. That's where "message delayed" is useful.. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --FsscpQKzF/jJk6ya Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAljniccACgkQMOfwapXb+vIHDgCgj2kAroZFHFUBj4ndjC+coXuf cdQAn1MaqOGkp///kR7anMj7JPZrEy3R =XCmO -----END PGP SIGNATURE----- --FsscpQKzF/jJk6ya--