3 ms·
The DMA needs to cooperate with the MMU which is on the CPU these days (and has been for almost 3 decades now). It's a lot of work to set up DMA correctly given
by beagle3 6y ago
The DMA needs to cooperate with the MMU which is on the CPU these days (and has been for almost 3 decades now). It's a lot of work to set up DMA correctly given physical<->logical memory mapping - so it's only worth it if you have a really big chunk to copy.
- GeorgeTirebiter 6y agoThis is quite interesting. This, to me, seems like a systems bug. In the Embedded World, it is exceedingly common to use DMA for all high-speed transfers -- it's effectively a specialized parallel hardware 'MOV' instruction. Also, I have never had an occasion on modern PC hw to need mmap; read() lseek() are clean and less complex overall. Maybe I lack imagination.
- astrange 6y agommap is being used by libraries under you; it's useful for files on internal drives, that won't be deleted, and want to be accessed randomly, and you don't want to allocate buffers to copy things out of them. For instance, anytime you call a shared library it's been mmapped by dyld/ld.so.
- __turbobrew__ 6y agoEvery time you run a dynamically linked program on linux the system linker mmaps your program + libraries into memory. You may not personally see mmap used, but it is used quite often in software you use.