From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 18 18:38:35 2008 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 F11B3106564A for ; Mon, 18 Aug 2008 18:38:35 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outP.internet-mail-service.net (outp.internet-mail-service.net [216.240.47.239]) by mx1.freebsd.org (Postfix) with ESMTP id D0F268FC28 for ; Mon, 18 Aug 2008 18:38:35 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id B24242364; Mon, 18 Aug 2008 11:38:35 -0700 (PDT) Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 506512D6076; Mon, 18 Aug 2008 11:38:35 -0700 (PDT) Message-ID: <48A9C1B0.5010805@elischer.org> Date: Mon, 18 Aug 2008 11:38:40 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Ed Maste References: <200808181754.18812.max@love2party.net> <20080818162411.GA77460@sandvine.com> <48A9BFED.604@elischer.org> In-Reply-To: <48A9BFED.604@elischer.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Acquiring a mtx after an sx 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, 18 Aug 2008 18:38:36 -0000 Julian Elischer wrote: > Ed Maste wrote: >> On Mon, Aug 18, 2008 at 12:02:56PM -0400, Ryan Stone wrote: >> >>> On Mon, Aug 18, 2008 at 11:54 AM, Max Laier wrote: >>> >>>> On Monday 18 August 2008 17:14:01 Ryan Stone wrote: >>>>> Are there any problems acquiring a sleep mutex after acquiring an sx >>>> lock? >>>>> man 9 locking says that you can't, but doesn't provide any reasons. >>>> [...] >>>> >>>> Where does it say so? The interaction table clearly shows: [...] >> >> Ahh, it seems ups' commit of rmlocks changed the "You have: sx_lock, >> You want: Slp_mtx" case from no to ok (in r173444). > > > hmmm > you know, I'm not sure what the correct answer is.. I thought rw locks > were mutex compatible but sx locks were NOT.. Ignore me.. I was reading the table backwards.. of course if you have an sx you can still take out a mutex, but not visa versa. An sx lock is considered related to a sleep. (i.e. may be long term) and as such must not be taken out when holding a mutex, which must not sleep. > >> >> -Ed >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to >> "freebsd-hackers-unsubscribe@freebsd.org" > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"