From owner-freebsd-smp Sun Dec 17 8: 3:15 2000 From owner-freebsd-smp@FreeBSD.ORG Sun Dec 17 08:03:13 2000 Return-Path: Delivered-To: freebsd-smp@freebsd.org Received: from berserker.bsdi.com (berserker.twistedbit.com [199.79.183.1]) by hub.freebsd.org (Postfix) with ESMTP id 09F7D37B400 for ; Sun, 17 Dec 2000 08:03:13 -0800 (PST) Received: from berserker.bsdi.com (cp@localhost.bsdi.com [127.0.0.1]) by berserker.bsdi.com (8.11.1/8.9.3) with ESMTP id eBHG2wP13434; Sun, 17 Dec 2000 09:02:58 -0700 (MST) (envelope-from cp@berserker.bsdi.com) Message-Id: <200012171602.eBHG2wP13434@berserker.bsdi.com> To: Bruce Evans Cc: smp@FreeBSD.ORG Subject: Re: atomic increment? In-reply-to: Your message of "Mon, 18 Dec 2000 00:40:46 +1100." From: Chuck Paterson Date: Sun, 17 Dec 2000 09:02:58 -0700 Sender: cp@berserker.bsdi.com Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Bruce, It was my understanding that declaring an asm volatile would generate all the same symantics as calling a function at that point. This is certainly the effect I have observed, and if you want to us atomic operations for locking, such as spin locks, it is the effect you better get. Am I wrong about this? This is why I thought the data in registers would be almost all discarded. FYI, The BSD/OS kernel builds -O2, without declaring the ams as volatile they would move all over the place. Turning on O2 found a boat load of incorrect assumptions about what ordering was guaranteed. Chuck To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message