It has indeed nothing to do whether you
execute as root or not
but depends on whether EPICS has the sufficient privilege to use
the real-time scheduler.
In many cases use of this scheduler is restricted but obviously
root always has sufficient privilege and such systems (without
additional measures) the simple formula is: executed as 'root'
EPICS will use the RT scheduler, executed as a normal user it
won't.
We configure our real-time systems usually so that the user
account
which starts EPICS IOCs does indeed have the privilege to use
the RT-scheduler. We do this by granting an unlimited hard
boundary
for real-time priorities (setrlimit(RLIMIT_RTPRIO) or 'ulimit'
from bash).
However, we also set the initial soft limit to zero.
This setup means that by default the user's EPICS (and other
processes)
cannot use the RT scheduler (since the soft limit is 0).
If the user wants to spawn an RT process then they lift the soft
limit
bash$ ulimit -S -r unlimited
and likewise for the amount of locked memory:
bash$ ulimit -S -l unlimited
Subsequently started processes can then use these resources which
are
critical for real-time performance.
I don't know the setup of your system but you could simply try
ulimit -S -r 0
and then your EPICS clients (and other processes) should not
be able to use the RT scheduler (and will not try to mlockall).
The rationale behind all of this is that
- since EPICS has the potential to operate as a real-time
application
it will try to do so if you let it (= if it determines it has
sufficient privilege)
assuming that was your intention
- real-time execution requires all real-time critical data, stack
and text to
permanently reside in memory. Since it would put a significant
burden on
the programmer to manually identify all critical memory areas
and
selectively lock these the complete process is locked in
memory.
We have diskless system here with 1G of RAM and there haven't
been
real issues with lack of memory.
- if EPICS determines it has not sufficient privilege to use the
RT scheduler
then it falls back on the vanilla scheduler and will not
attempt to lock
the process in memory.
I can also recommend to read this wiki page
https://wiki-ext.aps.anl.gov/epics/index.php/How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux
HTH
- Till
On 11/24/2015 04:22 AM, Henrique Almeida wrote: