From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 18 15:54:21 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 EDB87106566B for ; Mon, 18 Aug 2008 15:54:21 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by mx1.freebsd.org (Postfix) with ESMTP id 7ED7C8FC14 for ; Mon, 18 Aug 2008 15:54:21 +0000 (UTC) (envelope-from max@love2party.net) Received: from vampire.homelinux.org (dslb-088-066-002-184.pools.arcor-ip.net [88.66.2.184]) by mrelayeu.kundenserver.de (node=mrelayeu3) with ESMTP (Nemesis) id 0MKxQS-1KV73j3CDF-0000j4; Mon, 18 Aug 2008 17:54:20 +0200 Received: (qmail 6310 invoked from network); 18 Aug 2008 15:54:19 -0000 Received: from fbsd8.laiers.local (192.168.4.151) by router.laiers.local with SMTP; 18 Aug 2008 15:54:19 -0000 From: Max Laier Organization: FreeBSD To: freebsd-hackers@freebsd.org Date: Mon, 18 Aug 2008 17:54:18 +0200 User-Agent: KMail/1.10.0 (FreeBSD/8.0-CURRENT; KDE/4.1.0; i386; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200808181754.18812.max@love2party.net> X-Provags-ID: V01U2FsdGVkX195kLIUxnEjVqQ/dw1Xg4QG5JQQxfPwUyIpDyV IqwCqQW5lq54yW8eWEPzbOZB961M9PgeUVIuP/3iv3LzVrkc7Z BfJ0wTs03TKa8OMVZVSFA== Cc: Ryan Stone 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 15:54:22 -0000 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. > Obviously while you're holding the mutex you have to abide by the rules > applying to mutexes, but as long as you do that, I can't see why acquiring > a mutex after an sx lock would cause an issue. Is the locking man page > wrong about this? Where does it say so? The interaction table clearly shows: You have: You want: Spin_mtx Slp_mtx sx_lock rw_lock rm_locksleep SPIN mutex ok-1 no no no no no-3 Sleep mutex ok ok-1 no ok ok no-3 | V sx_lock ok -->ok<-- ok-2 ok ok ok-4 ^ | rw_lock ok ok no ok-2 ok no-3 rm_lock ok ok no ok ok-2 no -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News