Re: [PATCH] Define wc_wmb, a write barrier for PCI write combining

From: Benjamin LaHaise
Date: Sat Feb 25 2006 - 12:44:32 EST


On Sat, Feb 25, 2006 at 09:11:57AM -0800, Bryan O'Sullivan wrote:
> On Sat, 2006-02-25 at 09:28 -0500, Benjamin LaHaise wrote:
>
> > sfence has no impact
> > on the flushing of the write combining buffers
>
> The sfence instruction guarantees that every store that precedes it in
> program order is globally visible, including over the likes of the PCI
> bus, before any store instruction that follows the fence.

That is not the same as saying the write buffers are flushed and wholly
visible to their destination, it just means that subsequent reads or
writes will not be reordered prior to the sfence instruction. It is
entirely possible that the writes will remain in buffers on the CPU until
well after the sfence instruction has executed, sfence only affects the
order in which they become visible on the bus. If you want to force a
flush, a read from the PCI device is the only way to accomplish that.

-ben
--
"Ladies and gentlemen, I'm sorry to interrupt, but the police are here
and they've asked us to stop the party." Don't Email: <dont@xxxxxxxxx>.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/