From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Date: Wed, 29 Mar 2006 00:07:38 +0000 Subject: Re: Fix unlock_buffer() to work the same way as bit_unlock() Message-Id: <4429CFCA.7010201@yahoo.com.au> List-Id: References: <200603281853.k2SIrGg28290@unix-os.sc.intel.com> <4429ADBC.50507@free.fr> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Christoph Lameter Cc: Zoltan Menyhart , "Chen, Kenneth W" , akpm@osdl.org, linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org Christoph Lameter wrote: >On Tue, 28 Mar 2006, Zoltan Menyhart wrote: > > >>Why not to use separate bit operations for different purposes? >> >>- e.g. "test_and_set_bit_N_acquire()" for lock acquisition >>- "test_and_set_bit()", "clear_bit()" as they are today >>- "release_N_clear_bit()"... >> >> > >That would force IA64 specifics onto all other architectures. > >Could we simply define these smb_mb__*_clear_bit to be noops >and then make the atomic bit ops to have full barriers? That would satisfy >Nick's objections. > > Well yes, I think the current operations should not be changed because that would probably require large and difficult audits of the tree. However, I think it might be reaonsable to use bit lock operations for in places like page lock and buffer lock (ie. with acquire and relese semantics). It improves ia64 without harming other architectures, and also makes the code more expressive. >Index: linux-2.6.16/include/asm-ia64/bitops.h >=================================>--- linux-2.6.16.orig/include/asm-ia64/bitops.h 2006-03-19 21:53:29.000000000 -0800 >+++ linux-2.6.16/include/asm-ia64/bitops.h 2006-03-28 15:45:08.000000000 -0800 >@@ -45,6 +45,7 @@ > old = *m; > new = old | bit; > } while (cmpxchg_acq(m, old, new) != old); >+ smb_mb(); > } > > Can this allow the actual bitop to move up past previous memory ops? Would it be sufficient to just put a release barrier above the acquire barrier? -- Send instant messages to your online friends http://au.messenger.yahoo.com