Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030281AbWAUBuA (ORCPT ); Fri, 20 Jan 2006 20:50:00 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932387AbWAUBuA (ORCPT ); Fri, 20 Jan 2006 20:50:00 -0500 Received: from ns.suse.de ([195.135.220.2]:16035 "EHLO mx1.suse.de") by vger.kernel.org with ESMTP id S932374AbWAUBt7 (ORCPT ); Fri, 20 Jan 2006 20:49:59 -0500 From: Andreas Schwab To: Trond Myklebust Cc: Chuck Ebbert <76306.1226@compuserve.com>, linux-kernel , Andi Kleen , Andrew Morton , Ingo Molnar , Linus Torvalds Subject: Re: set_bit() is broken on i386? References: <200601201955_MC3-1-B649-DCF5@compuserve.com> <1137806107.8691.25.camel@lade.trondhjem.org> X-Yow: Yes, Private DOBERMAN!! Date: Sat, 21 Jan 2006 02:49:53 +0100 In-Reply-To: <1137806107.8691.25.camel@lade.trondhjem.org> (Trond Myklebust's message of "Fri, 20 Jan 2006 20:15:07 -0500") Message-ID: User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 958 Lines: 30 Trond Myklebust writes: > On Fri, 2006-01-20 at 19:53 -0500, Chuck Ebbert wrote: > >> #define ADDR (*(volatile long *) addr) >> static inline void set_bit(int nr, volatile unsigned long * addr) >> { >> __asm__ __volatile__( "lock ; " >> "btsl %1,%0" >> :"=m" (ADDR) >> :"Ir" (nr)); >> } > > The asm needs a memory clobber in order to avoid reordering with the > assignment to b[1]: Check out 2.6.16-rc1, this has already been fixed. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstra?e 5, 90409 N?rnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/