SHORT: I cannot find the mmap way of the open O_WRONLY file.
LONG: I'm looking for a way to write DMA (s / g mode) data to a PARTITION (!) Drive as quickly as possible, avoiding kernel buffering. O_DIRECT does not work, and Linus forbids its use.
For this, I mmap each DMA buffer with MAP_FIXED and the corresponding offset in the file. But if the file opens as O_RDWR , this forces the kernel to compete with DMA when filling the input RAM with the file data. In most cases, the kernel wins ... :)
So, I have to explain to the kernel that it should not touch my pages, just write them to the associated file when I call msync() . How?
source share