From owner-freebsd-current Mon Jul 12 1: 2:23 1999 Delivered-To: freebsd-current@freebsd.org Received: from herring.nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (Postfix) with ESMTP id 37DE71520F for ; Mon, 12 Jul 1999 01:02:19 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from salmon.nlsystems.com (salmon.nlsystems.com [10.0.0.3]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id JAA14597; Mon, 12 Jul 1999 09:00:59 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Mon, 12 Jul 1999 09:00:59 +0100 (BST) From: Doug Rabson To: Peter Jeremy Cc: mike@ducky.net, freebsd-current@freebsd.org Subject: Re: "objtrm" problem probably found (was Re: Stuck in "objtrm") In-Reply-To: <99Jul12.085624est.40350@border.alcanet.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 12 Jul 1999, Peter Jeremy wrote: > Mike Haertel wrote: > >Um. FYI on x86, even if the compiler generates the RMW > >form "addl $1, foo", it's not atomic. If you want it to > >be atomic you have to precede the opcode with a LOCK > >prefix 0xF0. > > I'd noticed that point as well. The top of sys/i386/include/atomic.h > _does_ make is clear that they aren't SMP safe: > > /* > * Various simple arithmetic on memory which is atomic in the presence > * of interrupts. > * > * Note: these versions are not SMP safe. > */ > > That said, it should be fairly simple to change Matt's new in-line > assembler versions to insert LOCK prefixes when building an SMP > kernel. (Although I don't know that this is necessary yet, given > the `Big Giant Lock'). We don't need the lock prefix for the current SMP implementation. A lock prefix would be needed in a multithreaded implementation but should not be added unless the kernel is an SMP kernel otherwise UP performance would suffer. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message