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

From: Roland Dreier (
Date: Sat Jun 08 2002 - 19:40:24 EST

>>>>> "David" == David S Miller <> 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)?

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sat Jun 15 2002 - 22:00:13 EST