Skip to contentSkip to conversation

generic device DMA implementation

RFC Adam J. Richter 1 participant 1 message Dec 5, 2002

lore
Share & tools
lore
#0 lore raw

At the risk of beating a dead horse, I'd like to clarify a potential ambiguity.

Quoted 8 lines · David Gibson

It seems the "try to get consistent memory, but otherwise give me inconsistent" is only useful on machines which:
(1) Are not fully consisent, BUT
(2) Can get consistent memory without disabling the cache, BUT
(3) Not very much of it, so you might run out.

The point is, there has to be an advantage to using consistent memory if it is available AND the possibility of it not being available.

It is enough that there is an advantage to using consistent
memory on one platform (such as sparc64?) and the possibility of it not being available on another platform (such as parisc), given that you want the driver on both platforms (such as 53c700). In that case, we have identified three possible choices so far:

APPROACH PROBLEMS

1. Use both memory allocators. Increased source and object size,
(as 53c700 currently does) rarely used code branches, unneeded
"if (!consistent)" tests on platforms where the answer is constant.

2. Assume only inconsistent memory. Slower on platforms where consistent
memory has speed advantage

3. Have "maybe consistent" allocation
and {w,r}mb_maybe(addr,len) macros.

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."