From owner-acpi-jp@jp.freebsd.org  Wed Nov  7 02:39:20 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id CAA04637;
	Wed, 7 Nov 2001 02:39:20 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from mail6.speakeasy.net (mail6.speakeasy.net [216.254.0.206])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id CAA04628
	for <acpi-jp@jp.FreeBSD.org>; Wed, 7 Nov 2001 02:39:19 +0900 (JST)
	(envelope-from jhb@FreeBSD.org)
Received: (qmail 13525 invoked from network); 6 Nov 2001 17:39:16 -0000
Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender <jhb@FreeBSD.org>)
          by mail6.speakeasy.net (qmail-ldap-1.03) with SMTP
          for <robert.moore@intel.com>; 6 Nov 2001 17:39:16 -0000
Message-ID: <XFMail.011106093916.jhb@FreeBSD.org>
X-Mailer: XFMail 1.4.0 on FreeBSD
X-Priority: 3 (Normal)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
In-Reply-To: <B9ECACBD6885D5119ADC00508B68C1EA2FDFDD@orsmsx107.jf.intel.com>
Date: Tue, 06 Nov 2001 09:39:16 -0800 (PST)
From: John Baldwin <jhb@FreeBSD.org>
To: "Moore, Robert" <robert.moore@intel.com>
Cc: Mitsuru IWASAKI <iwasaki@jp.FreeBSD.org>, acpi-jp@jp.FreeBSD.org, Grover,
        Andrew <andrew.grover@intel.com>, Therien, Guy <guy.therien@intel.com>,
        Diefenbaugh, Paul S <paul.s.diefenbaugh@intel.com>
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+010328
X-Sequence: acpi-jp 1445
Subject: [acpi-jp 1445] RE: ACPI CA  Mutex patches
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: jhb@FreeBSD.org


On 06-Nov-01 Moore, Robert wrote:
> 
> Release order matters if you have multiple threads using the mutexes.
> 
> To quote from the ACPI specification section for the Mutex object:
> 
> "To prevent deadlocks, wherever more than one synchronization object must be
> owned, the synchronization objects must always be released in the order
> opposite the order in which they were acquired."
> 
> The SyncLevel parameter to the Mutex object is intended to help enforce
> this.

Well, if that's the way you define it then you had better enforce it I guess. 
I guess this is more of an implementation detail if you change SyncLevel on
mutex release with this assumption (i.e. lower it to the level of the mutex you
are releasing minus one) rather than walking the list of still held mutexes and
setting it to the highest level.

From a theory standpoint, there's no reason to bother caring about release
orders, just acquire orders.

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/
