From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 08:52:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A78581065675; Thu, 16 Feb 2012 08:52:05 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 580768FC14; Thu, 16 Feb 2012 08:52:05 +0000 (UTC) Received: from julian-mac.elischer.org (c-67-180-24-15.hsd1.ca.comcast.net [67.180.24.15]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id q1G8q2f1011345 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 16 Feb 2012 00:52:04 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <4F3CC40D.4000307@freebsd.org> Date: Thu, 16 Feb 2012 00:53:33 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.26) Gecko/20120129 Thunderbird/3.1.18 MIME-Version: 1.0 To: Bruce Evans References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> In-Reply-To: <20120216181210.K1423@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 08:52:05 -0000 On 2/16/12 12:39 AM, Bruce Evans wrote: > On Thu, 16 Feb 2012, Eitan Adler wrote: > >> Log: >> Add a timestamp to the msgbuf output in order to determine when when >> messages were printed. >> >> This can be enabled with the kern.msgbuf_show_timestamp sysctl > > Apart from being fundamentally broken, this adds lots of bloat and > style bugs. The msgbuf is a very low-level interface, and was > careful not to do stuff like this. I'm still waiting for the previous > round of breakage of it, that replaces careful atomic ops by spinlocks, > to be backed out. Code at this level cannot use any normal locking, > and used to be carefully written to not do so. The spinlocks break it, > for example, if there is a trap while holding the lock and the trap > handler wants to use the message buffer. Interrupts are possible > too, but they are disabled on the same CPU for technical reasons, so > they cannot cause deadlock here. The main possiblities for traps are > NMIs. The NMI handler shouldn't call printf, but perhaps it does. > It might cause a panic. Then panic can only print by blowing open > the locks. It might be a STOP IPI. The stop function uses printf > to diagnose other blockages, at least with certain options. Anyway > printf must never block endlessly, so msgbuf functions must not never > block endlessly either, so neither can use any normal locking, since > normal locking can easily block endlessly in deadlock conditions, by > the definition of deadlock. Bruce, this is a good example of a legitimate gripe going un-noticed because you didn't shout loud enough at the right time, at the right people. It's been about 20 years since we started working on this but I've finally come to the point of saying that we need you to do more when you see problems. object officially if you think things should be backed out! your reasons here seem sound, so it's hard to see why you haven't been more public about it. Julian