diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index 3db8233c0..db20d167c 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -15,6 +15,29 @@ EPICS Base 3.15.0.x releases are not intended for use in production systems.

Changes between 3.15.0.1 and 3.15.0.2

+

On POSIX, attempt to lock all memory when running with FIFO scheduler

+ +

On POSIX systems, an IOC application's ability to meet timing deadlines is often +dependent on its ability to lock part or all of the process's virtual address space +into RAM, preventing that memory from being paged to the swap area. This change will +attempt to lock the process's virtual address space into RAM if the process has the +ability to run threads with different priorities. If unsuccessful, it prints an +message to stderr and continues.

+ +

On Linux, one can grant a process the ability to run threads with different +priorities by using the command ulimit -r unlimited. To use the FIFO +scheduler for an IOC, use a command like this:

+ +
chrt -f 1 softIoc -d test.db
+ +

On Linux, one can grant a process the ability to lock memory using the command +ulimit -l unlimited. These limits can also be configured on a per +user/per group basis by changing /etc/security/limits.conf or its equivalent.

+ +

In Linux, a child process created via fork inherits its parent's resource +limits. Thus, it is probably a good idea to start the caRepeater before +starting the IOC.

+

Implement EPICS_CAS_INTF_ADDR_LIST in rsrv

The IOC server can now bind to a single IP address (and optional port number) diff --git a/src/libCom/osi/os/posix/osdThread.c b/src/libCom/osi/os/posix/osdThread.c index 18cc0b67b..90e8de7c3 100644 --- a/src/libCom/osi/os/posix/osdThread.c +++ b/src/libCom/osi/os/posix/osdThread.c @@ -35,6 +35,13 @@ #include "epicsAssert.h" #include "epicsExit.h" +#if defined(linux) +#if _POSIX_MEMLOCK > 0 +#include +#endif +#endif + + epicsShareFunc void epicsThreadShowInfo(epicsThreadOSD *pthreadInfo, unsigned int level); epicsShareFunc void osdThreadHooksRun(epicsThreadId id); epicsShareFunc void osdThreadHooksRunMain(epicsThreadId id); @@ -344,6 +351,23 @@ static void once(void) fprintf(stderr,"sched_get_priority_min failed set to %d\n", pcommonAttr->maxPriority); } + +#if _POSIX_MEMLOCK > 0 + if(errVerbose) { + fprintf(stderr, "LRT: min priority: %d max priority %d\n", + pcommonAttr->minPriority, pcommonAttr->maxPriority); + } + if (pcommonAttr->maxPriority > pcommonAttr->minPriority) { + status = mlockall(MCL_CURRENT | MCL_FUTURE); + if(status) { + fprintf(stderr, "Unable to lock the virtual address space using mlockall\n"); + } else { + fprintf(stderr,"Successfully locked memory using mlockAll\n"); + } + } +#endif + + #else if(errVerbose) fprintf(stderr,"task priorities are not implemented\n"); #endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */