Re: KeFlushIoBuffers() before or after DMA?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Didn't we already say that buffers involved in DMA transfers must not
share cache lines with any other data?

Host to device DMA is not that critical but device to host is.

Also, many devices implement DMA burst transfers, which always fill
whole cache lines.

Please reviese your assumptions on cache behaviour.

Stephan
---
BubbaGump wrote:
On 16 Sep 2006 10:24:18 -0700, "Stephan Wolf [MVP]"
<stewo68@xxxxxxxxxxx> wrote:

If you read from some memory location that is not currently in the
cache, the cache logic will read from host memory. What else should it
do? So an invalidate is only required once and before a DMA transfer to
host memory.

Part of the benefit of a cache is less overhead for individual loads
and stores because a full cache line is transferred to/from memory at
once. When a single word is accessed there's a good chance software
will later access the word that precedes or follows it pretty soon,
and that word will then already be in the cache. There's also a good
chance software will access a word in the next few or previous few
cache lines, so if the caching algorithm is so designed then why might
the cache hardware not also pull those cache lines in along with the
original cache line? Reading from memory is non-destructive and won't
disturb the transfer because it's ordinary memory, but if a DMA
transfer was in progress while this was happening then it might
overlap those other cache lines and require another cache invalidation
afterwards.

.



Relevant Pages

  • Re: use/cause of ide=nodma boot parameter?
    ... Some drives do not work reliable with DMA. ... Various chip sets manage memory and cache differently. ... For some chip sets the DMA engines are shared and if the DMA engine is ...
    (Fedora)
  • Re: Volatile variables
    ... I/O methods ("DMA" and the like) that completely bypass the CPU. ... then DMA bypasses the on-chip cache. ... memory. ...
    (comp.lang.c)
  • Re: Problem with INVD instruction
    ... :> I am using DPMI and GNU C compiler on Pentium 4 motherboard. ... :> I have a PCI card which is transfering data to main memory of PC using DMA ... In order to read physical memory address I am using farpeekl. ... My old data is in the cache because before actual DMA I fill memory ...
    (comp.lang.asm.x86)
  • Re: caching-namserver
    ... Could be a function of how busy your system and/or CPU size, memory, etc. ... the "Automatically obtain DNS information from provider" selection in ... You will lose the cache on a reboot since that information is contained ... host will be cleared and a new request will be sent. ...
    (Fedora)
  • Re: Weird Behaviour of Blackfin BF533 cache !!!!!!!!!!!!!!
    ... cycles.So I had a chance to experiment with the cache. ... BlackFin doesn't have any means for providing cache and DMA coherency. ... Hence you generally can't DMA to the memory areas which are covered by ... on both oaccasions was residing in the internal memory. ...
    (comp.dsp)