From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org ([203.10.76.45]:20156 "EHLO ozlabs.org") by vger.kernel.org with ESMTP id S1750767AbWCIHlL (ORCPT ); Thu, 9 Mar 2006 02:41:11 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17423.56336.993754.818818@cargo.ozlabs.ibm.com> Date: Thu, 9 Mar 2006 18:41:04 +1100 From: Paul Mackerras Subject: Re: [PATCH] Document Linux's memory barriers [try #2] In-Reply-To: <200603082036.19811.jbarnes@virtuousgeek.org> References: <17423.42185.78767.837295@cargo.ozlabs.ibm.com> <200603082036.19811.jbarnes@virtuousgeek.org> Sender: linux-arch-owner@vger.kernel.org To: Jesse Barnes Cc: Linus Torvalds , akpm@osdl.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, Alan Cox , linuxppc64-dev@ozlabs.org List-ID: Jesse Barnes writes: > Hm, a static checker should be able to find this stuff, shouldn't it? Good idea. I wonder if sparse could be extended to do it. Alternatively, it wouldn't be hard to check dynamically. Just have a per-cpu count of outstanding MMIO stores. Zero it in spin_lock and mmiowb, increment it in write*, and grizzle if spin_unlock finds it non-zero. Should be very little overhead. Paul.