That’s absurd. If the DMA hardware is busy reading/writing system memory,
then the processor will have little or no access to system memory. And on
processors where the memory manager is integrated into the processor itself
(including most current AMD parts), the DMA controller is going to
essentially be asking the processor to do what the processor can already do,
and to do it much more slowly.
This also ignores the processor cache, both for coherency and for data
locality. Caching effects have a huge impact on performance. The read
portion of memcpy() will be able to make use of the processor cache. It
will also fill the cache on writes, which may not be what you want.
Fortunately, x86 (and x64, and probably most other archs) provides a
“non-temporal” instruction prefix. This prefix allows the processor to read
from cache (use existing data in the cache), but not to store data in the
cache during writes. This prevents a large block-copy from flushing data
from the processor cache(s).
In all cases, memcpy() preserves cache coherency.
Also, the front-end instruction decoders on most modern processors recognize
REP MOV sequences, and convert these into burst reads/write cycles.
Maxim is right. memcpy() is best. At least until you (original poster)
have proven otherwise, with real data from performance analysis.
– arlie
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Alberto Moreira
Sent: Wednesday, November 23, 2005 9:56 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] memory-to-memory DMA
It may be slow latencywise, but if you need the processor for other things -
such as industry strength scientific computation - you don’t want it to be
wasting cycles doing rep movs unless they’re response-time-critical.
Hardwarewise, being able to do memory to memory dma will depend on how the
bridge works; The bridge talks directly to memory, so, in theory the bridge
should be able to move data inside the memory at maximum memory throughput.
The situation is not very different from moving data inside video memory:
yes the host can see it, yes it can use rep movs, but no the cpu can’t beat
the speed of a chip-managed bitblt.
Now, the question is, why do it unless there’s real need ? But think,
streaming video can be reduced to memory-to-memory dma, only that the target
memory is chip-managed and not bridge-managed.
Alberto.
----- Original Message -----
From: “Maxim S. Shatskih”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, November 23, 2005 5:19 AM
Subject: Re: [ntdev] memory-to-memory DMA
> No. The DMA APIs in Windows kernel do not support this,
> since this is a
> very bad idea (slow).
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
> ----- Original Message -----
> From: “Kannan, Raja”
> To: “Windows System Software Devs Interest List”
>
> Sent: Wednesday, November 23, 2005 11:24 AM
> Subject: RE: [ntdev] memory-to-memory DMA
>
>
> So you meant that there is a (un)documented API to support
> this feature?
>
> ________________________________
>
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of David
> J. Craig
> Sent: Wednesday, November 23, 2005 12:46 PM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] memory-to-memory DMA
>
>
> Of course it is possible. Search the web. Go for it. It
> should slow
> you down rather nicely.
>
> “Kannan, Raja” wrote in
> message
> news:xxxxx@ntdev…
>
>
> Hi all,
>
> Is it possible to do memory-to-memory copy using system DMA
> controller?
>
> Is any windows system API supporting this feature? Or we have
> to
> do our own assembly language coding for that?
>
> I think, first of all the DMA controller is capable to support
> this feature. Intel 8237 support this features. But today’s PC
> comes
> with 8237 DMA controller?
>
> Can anyone provide me with some source code to do this?
>
> Thank you
> Raja
>
>
>
>
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
> argument:
> ‘’
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
> argument: ‘’
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@ieee.org
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@stonestreetone.com
To unsubscribe send a blank email to xxxxx@lists.osr.com