Prevent minor page crashes in real time on Linux

I need the process to run in real time as much as possible.

All communications are done through files with shared memory — memory — no system calls at all — it uses the wait in shared memory.

The process runs under real-time priority, and all memory is locked using mlockall(MCL_CURRENT|MCL_FUTURE) , which completed successfully, and the process has enough ulimits to lock all memory.

When I run it on it perf stat -p PID , I still get counts of minor page errors.

I tested this as an affinity of the process, and without it.

Question:

Is it even possible to eliminate them - even minor page errors?

+6
source share
2 answers

I solved this problem by switching memory files to POSIX shared memory shm_open + memory lock.

+5
source

If I understand the question correctly, it is impossible to completely avoid the flaw in the secondary pages. In most modern operating systems, including Linux, the OS does not load all segments of text and data into memory when programs are launched. It highlights internal data structures, and pages are essentially erroneous when text and data are needed. This causes physical page fault memory available to the process, replacing the page from the backup storage. This way you can avoid a minor page error by not accessing the backup storage, which may not be possible.

0
source

All Articles