From owner-cvs-all Sat Nov 16 11:13:21 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 49D8A37B401; Sat, 16 Nov 2002 11:13:20 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id C662743E42; Sat, 16 Nov 2002 11:13:19 -0800 (PST) (envelope-from eischen@pcnet1.pcnet.com) Received: from localhost (eischen@localhost) by mail.pcnet.com (8.12.3/8.12.1) with ESMTP id gAGJDJF8014631; Sat, 16 Nov 2002 14:13:19 -0500 (EST) Date: Sat, 16 Nov 2002 14:13:19 -0500 (EST) From: Daniel Eischen To: Marcel Moolenaar Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libc_r/arch/ia64 _atomic_lock.S In-Reply-To: <20021116185125.GB618@dhcp01.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 16 Nov 2002, Marcel Moolenaar wrote: > On Sat, Nov 16, 2002 at 01:08:58PM -0500, Daniel Eischen wrote: > > > marcel 2002/11/16 09:05:06 PST > > > > > > Modified files: > > > lib/libc_r/arch/ia64 _atomic_lock.S > > > Log: > > > Implement the lock with a cmpxchg instruction instead of a xchg. > > > Both are atomic, but the cmpxchg has memory ordering hints. We > > > give this acquire semantics. > > > > > > NOTE: The unlock in libc_r is implemented by a "normal" assign > > > statement. This is not correct on ia64 due to the memory ordering > > > characteristics of the architecture. We need release semantics > > > for an unlock. > > > > We can fix that before 5.0 goes out. > > That would be great. We can special-case ia64 by calling > _spinunlock(), which for libc_r resolves to _atomic_unlock() > which would have a single store with release semantics. > That way we don't pessimize archs with strong memory ordering. > > If you want me to send patches, let me know. I'm trying to figure > out what to do now that the *context functions have been turned > into syscalls. It complicates things... I'm working on converting libc_r to use *context() so don't worry about doing it yourself. > BTW: Thanks for updating sys/ia64/ia32/syscalls.master. I haven't > seen the re-gen yet but don't worry about it. I'm behind on my > mail... Oh, I didn't know I had to regen those. I'll try and do it and if it's not obvious, I'll shoot you some email. -- Dan Eischen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message