Re: PCI DMA to small buffers on cache-incoherent arch

Roland Dreier (roland@topspin.com)
08 Jun 2002 17:40:24 -0700


>>>>> "David" == David S Miller <davem@redhat.com> writes:

David> There is no allocation scheme legal for PCI DMA which gives
David> you smaller than a cacheline of data, this includes SLAB.
David> This is why stack buffers and the like are illegal for PCI
David> DMA.

David> If the architecture allows SLAB to give smaller than
David> cacheline sized data, it must handle PCI DMA map/unmap
David> flushing in an appropriate fashion (ie. handle
David> sub-cacheline buffers).

Thanks, that's great information. However, there is one question you
didn't cover. How about using a sub-cache-line piece of a kmalloc()'ed
buffer (eg the case I described of using one member from a struct as a
DMA buffer)? As far as I can see there is no guarantee that this will
always work. Do you agree that this should be treated as a bug and
fixed when it is found? Or should we leave that usage unless it is
observed causing problems (since we almost always get lucky and don't
touch the rest of the cache line near the DMA)?

Thanks,
Roland
-
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/