EPICS Multi-Core Utilities  1.2.3-SNAPSHOT
Real-Time Utilities for EPICS IOCs on Multi-Core Linux
Files | Functions
Memory Locking

Add functions for locking the process memory into RAM. More...

Files

file  memLock.c
 Locking process memory into RAM.
 

Functions

epicsShareFunc void mcoreMLock (void)
 iocShell: Lock all process virtual memory into RAM. More...
 
epicsShareFunc void mcoreMUnlock (void)
 iocShell: Unlock process virtual memory from RAM. More...
 

Detailed Description

Add functions for locking the process memory into RAM.

Adds functions that allow locking and unlocking the process virtual memory into RAM to make sure no page faults occur, which would introduce unpredictable interruptions and latency.

See man page for mlockall(2) for more details on memory locking.

Linux Security (non-systemd)
To allow locking all its memory, under modern Linux systems the process must have a memlock entry in the pam limits module configuration.
See the limits.conf(5) man page for details.
Linux Security (systemd)
If an IOC process is started by systemd the following configuration is required in the unit file to grant the IOC process permission to adjust real-time priorities as well as to lock memory:
[Service]
LimitMEMLOCK=infinity
LimitRTPRIO=99
Refer to the systemd documentation for details.
Use with EPICS >=3.15.4
Starting with EPICS Base 3.15.4, IOCs are automatically calling mlockall if the IOC process is allowed to set different thread priorities (that is if sched_get_priority_max() > sched_get_priority_min()). The following commands are thus only needed with older IOCs as well as for troubleshooting.

Function Documentation

◆ mcoreMLock()

epicsShareFunc void mcoreMLock ( void  )

iocShell: Lock all process virtual memory into RAM.

IOC Shell
mcoreMLock

Definition at line 34 of file memLock.c.

◆ mcoreMUnlock()

epicsShareFunc void mcoreMUnlock ( void  )

iocShell: Unlock process virtual memory from RAM.

IOC Shell
mcoreMUnlock

Definition at line 40 of file memLock.c.