On Tue, 2006-02-28 at 14:03 -0500, Benjamin LaHaise wrote: > Memory barriers are not cheap. At least for the example you provided, > it looks like things are overdone and performance is going to suck, so > it needs to be avoided if at all possible. There's more to it than that :-) We added the memory barrier to *improve* performance, in addition to helping correctness and portability. Without it, the CPU or north bridge is free to hold onto the pending writes for a while; the exact details of how long it will wait depend on the CPU and NB implementation, but on AMD64 CPUs the delay is up to 16 cycles. So if we just use wmb(), we incur a 16-cycle penalty on every packet we send. This has a deleterious and measurable effect on performance. <b - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH] Define wc_wmb, a write barrier for PCI write combining
- From: Benjamin LaHaise <[email protected]>
- Re: [PATCH] Define wc_wmb, a write barrier for PCI write combining
- From: Andi Kleen <[email protected]>
- Re: [PATCH] Define wc_wmb, a write barrier for PCI write combining
- References:
- [PATCH] Define wc_wmb, a write barrier for PCI write combining
- From: "Bryan O'Sullivan" <[email protected]>
- Re: [PATCH] Define wc_wmb, a write barrier for PCI write combining
- From: Benjamin LaHaise <[email protected]>
- Re: [PATCH] Define wc_wmb, a write barrier for PCI write combining
- From: "Bryan O'Sullivan" <[email protected]>
- Re: [PATCH] Define wc_wmb, a write barrier for PCI write combining
- From: Benjamin LaHaise <[email protected]>
- Re: [PATCH] Define wc_wmb, a write barrier for PCI write combining
- From: "Bryan O'Sullivan" <[email protected]>
- Re: [PATCH] Define wc_wmb, a write barrier for PCI write combining
- From: Benjamin LaHaise <[email protected]>
- Re: [PATCH] Define wc_wmb, a write barrier for PCI write combining
- From: "Bryan O'Sullivan" <[email protected]>
- Re: [PATCH] Define wc_wmb, a write barrier for PCI write combining
- From: Benjamin LaHaise <[email protected]>
- [PATCH] Define wc_wmb, a write barrier for PCI write combining
- Prev by Date: Re: [PATCH 2/13] ATA ACPI: debugging infrastructure
- Next by Date: Re: make dep -problem
- Previous by thread: Re: [PATCH] Define wc_wmb, a write barrier for PCI write combining
- Next by thread: Re: [PATCH] Define wc_wmb, a write barrier for PCI write combining
- Index(es):