Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751193AbWBBVMX (ORCPT ); Thu, 2 Feb 2006 16:12:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751195AbWBBVMX (ORCPT ); Thu, 2 Feb 2006 16:12:23 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:37518 "HELO iolanthe.rowland.org") by vger.kernel.org with SMTP id S1751193AbWBBVMW (ORCPT ); Thu, 2 Feb 2006 16:12:22 -0500 Date: Thu, 2 Feb 2006 16:12:16 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Kernel development list Subject: Question about memory barriers Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 860 Lines: 19 The kernel's documentation about memory barriers is rather skimpy. I gather that rmb() guarantees that all preceding reads will have completed before any following reads are made, and wmb() guarantees that all preceding writes will have completed before any following writes are made. I also gather that mb() is essentially the same as rmb() and wmb() put together. But suppose I need to prevent a read from being moved past a write? It doesn't look like either rmb() or wmb() will do this. And if mb() is the same as "rmb(); wmb();" then it won't either. So what's the right thing to do? Alan Stern - 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/