How to get records through a pointer to a memory card mounted in mmap, immediately clear the check box?

I am having a caching issue when using / dev / mem with mmap on a dual-processor ARM system (more precisely, Xilinx Zynq). My configuration is asymmetric: one processor is running Linux, and the other processor is running a simple metal application. They interact through a RAM block that is not in the Linux virtual memory (it was excluded by the devicetree file). When my Linux application for Linux space is written to memory using the pointer returned from mmap (), it can take from 100 ms to more than a second for the second processor to detect the modified memory content.

In the open () call in / dev / mem, I tried to specify O_RDRW, O_SYNC and O_DIRECT, but O_DIRECT made open fail, so I deleted O_DIRECT. I thought that O_SYNC should ensure that the data was written to memory before calling write (), but instead of writing via write (), I use a memory pointer. I do not see any parameters in the mmap () call, which apparently affects caching issues.

I tried calling fsync (fd) and fdatasync () after writing to memory, but this did not change the behavior.

It seems that the DID seems to work, it spawns this command immediately after writing to memory: synchronization; echo 3 / proc / sys / vm / drop_caches

What is the easiest way to retrieve entries using the mapped memory pointer to immediately clear the checkbox?

+4
1

fsync .. (, ).

. , DRAM, ACP.

ACP , .

. , . , "portalmem" . , , ioctl , .

+1

All Articles