Skip to contentSkip to conversation

generic device DMA implementation

RFC Adam J. Richter 2 participants 2 messages Dec 5, 2002 – Dec 6, 2002

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines · David Gibson

Since, with James's approach you'd need a dma sync function (which might compile to NOP) in pretty much the same places you'd need map/sync calls, I don't see that it does make the source noticeably simpler.

Because then you don't have to have a branch for
case where the platform *does* support consistent memory.

Quoted 8 lines
Quoted 5 lines

If were to try the approach of using pci_{map,sync}_single
always (i.e., just writing the code not to use alloc_consistent), that would have a performance cost on machines where using consistent memory for writing small amounts of data is cheaper than the cost of the cache flushes that would otherwise be required.

Well, I'm only talking about the cases where we actually care about reducing the use of consistent memory.

Then you're not fully weighing the benefits of this facility.
The primary beneficiaries of this facility are device drivers for which we'd like to have the performance advantages of consistent memory when available (at least on machines that always return consistent memory) but which we'd also like to have work as efficiently as possible on platforms that lack consistent memory or have so little that we want the device driver to still work even when no consistent memory is available. That includes all PCI devices that users of the inconsistent parisc machines want to use.

Adam J. Richter     __     ______________   575 Oroville Road
[email protected]     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America

"Free Software For The Rest Of Us."

#1 lore raw
Quoted 8 lines · Adam J. Richter
Quoted 4 lines · David Gibson

Since, with James's approach you'd need a dma sync function (which might compile to NOP) in pretty much the same places you'd need map/sync calls, I don't see that it does make the source noticeably simpler.

Because then you don't have to have a branch for
case where the platform *does* support consistent memory.

Sorry, you're going to have to explain where this extra branch is, I don't see it.

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

If were to try the approach of using pci_{map,sync}_single
always (i.e., just writing the code not to use alloc_consistent), that would have a performance cost on machines where using consistent memory for writing small amounts of data is cheaper than the cost of the cache flushes that would otherwise be required.

Quoted 8 lines
Quoted 2 lines

Well, I'm only talking about the cases where we actually care about reducing the use of consistent memory.

Then you're not fully weighing the benefits of this facility.
The primary beneficiaries of this facility are device drivers for which we'd like to have the performance advantages of consistent memory when available (at least on machines that always return consistent memory) but which we'd also like to have work as

What performance advantages of consistent memory? Can you name any non-fully-consistent platform where consistent memory is preferable when it is not strictly required? For, all the non-consistent platforms I'm aware of getting consistent memory means disabling the cache and therefore is to be avoided wherever it can be.

Quoted 4 lines

efficiently as possible on platforms that lack consistent memory or have so little that we want the device driver to still work even when no consistent memory is available. That includes all PCI devices that users of the inconsistent parisc machines want to use.

Signature · 4 lines
David Gibson			| For every complex problem there is a
[email protected]	| solution which is simple, neat and
				| wrong.
http://www.ozlabs.org/people/dgibson