From owner-p4-projects@FreeBSD.ORG Thu Nov 2 17:10:35 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0E13116A417; Thu, 2 Nov 2006 17:10:35 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DFC5516A407; Thu, 2 Nov 2006 17:10:34 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6708643D45; Thu, 2 Nov 2006 17:10:34 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [10.10.3.185] ([165.236.175.187]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id kA2HAMdb073515; Thu, 2 Nov 2006 10:10:28 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <454A2679.4030609@samsco.org> Date: Thu, 02 Nov 2006 10:10:17 -0700 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060206 X-Accept-Language: en-us, en MIME-Version: 1.0 To: John Baldwin References: <200611010112.kA11C1Jt066210@repoman.freebsd.org> <200611011047.07627.jhb@freebsd.org> <200611021222.48108.hselasky@c2i.net> <200611021151.19396.jhb@freebsd.org> In-Reply-To: <200611021151.19396.jhb@freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=3.8 tests=none autolearn=failed version=3.1.1 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on pooker.samsco.org Cc: Perforce Change Reviews , Scott Long , Hans Petter Selasky Subject: Re: PERFORCE change 108878 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Nov 2006 17:10:35 -0000 John Baldwin wrote: > On Thursday 02 November 2006 06:22, Hans Petter Selasky wrote: > >>On Wednesday 01 November 2006 16:47, John Baldwin wrote: >> >>>On Tuesday 31 October 2006 20:12, Scott Long wrote: >>> >>>>http://perforce.freebsd.org/chv.cgi?CH=108878 >>>> >>>>Change 108878 by scottl@scottl-x64 on 2006/11/01 01:11:30 >>>> >>>> For some wonderful reason, you cannot pass &Giant to msleep. Work >>>> around that in a crude fashion. Also add some more assertions. >>> >>>Ah, yes, that would be most unhappy. I guess mostly the idea is that Giant >>>should be rather implicit and explicitly using Giant for an object lock is >>>discouraged. I'm not sure that is what you are doing though. I think >>>maybe you are borrowing Giant that's already held? >> >>I use this patch: >> >>/* preliminary fix for a bug in msleep on FreeBSD, >> * which cannot sleep with Giant: >> */ >>#define msleep(i,m,p,w,t) msleep(i,(((m) == &Giant) ? NULL : (m)),p,w,t) >> >>Really this issue should be fixed. It happens just because GIANT_DROP is done >>too early in "msleep()". > > > Giant is special in msleep() and friends to make sure it is first in the > lock order, but unlock doesn't matter for lock order, and actually, the > current order is less intuitive. I think it's the way it is now because we > inherited it from BSD/OS. Also in theory old code under Giant should be > using tsleep() and not msleep() anyway. It actually won't hurt to move > DROP_GIANT later though. > > How about this: > This won't work for what I'm using it for. It's not a big deal, though. Scott