From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 13 18:49:27 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D82F10656C6; Mon, 13 Jul 2009 18:49:27 +0000 (UTC) (envelope-from rwatson@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id E980A8FC21; Mon, 13 Jul 2009 18:49:26 +0000 (UTC) (envelope-from rwatson@freebsd.org) Received: from [192.168.2.101] (host86-145-8-156.range86-145.btcentralplus.com [86.145.8.156]) by cyrus.watson.org (Postfix) with ESMTPSA id 09DF546B81; Mon, 13 Jul 2009 14:49:25 -0400 (EDT) Message-Id: <732D77F4-6D18-4724-A76C-FB38B9DAE0F1@freebsd.org> From: "Robert N. M. Watson" To: John Baldwin In-Reply-To: <200907131417.53876.jhb@freebsd.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Mon, 13 Jul 2009 19:49:24 +0100 References: <4A4740B8.8090205@embedded-brains.de> <200907131417.53876.jhb@freebsd.org> X-Mailer: Apple Mail (2.935.3) Cc: freebsd-hackers@freebsd.org, Sebastian Huber Subject: Re: callout(9) and Giant lock X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jul 2009 18:49:27 -0000 On 13 Jul 2009, at 19:17, John Baldwin wrote: >> Callouts are marked as MPSAFE or non-MPSAFE when registered. If >> non-MPSAFE, >> we will acquire Giant automatically for the callout, but I believe >> we'll also >> try and sort non-MPSAFE callouts behind MPSAFE ones in execution >> order to >> minimize latency for MPSAFE callouts. Most callouts acquire locks >> of some >> sort, and stalling any callout indefinitely will stall the entire >> callout >> thread indefinitely, which in turn could lead to a variety of odd >> behaviors >> and potentially (although not necessarily) deadlock. > > FWIW, we do not actually sort the callouts in this manner, so all > callouts > will be blocked until Giant is acquired. I must have been remembering a proposed change -- as you say, it's certainly not in kern_timeout.c. However, I'd rather just eliminate support for Giant in callouts in 9.x than try to further facilitate them :-) Robert