EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: set-user-id root and EPICS 3.15
From: Andrew Johnson <[email protected]>
To: <[email protected]>
Date: Fri, 29 Jan 2016 14:55:41 -0600
On 01/28/2016 08:43 AM, Ralph Lange wrote:
> However, this is the second time that we hear of trouble because people
> are running client applications (i.e. CA clients) in real-time context.
> In those cases, the memory locking might not be intended nor useful.
> There is no way for the OS abstraction layer (where the memlock happens)
> to know if the caller is an IOC type or a client type application.
> We already began to reconsider the automatic activation feature.

I think it would be reasonable to require those that want the mlockall()
behaviour to configure it. The main question would be whether this
should be configurable at build-time, or if it can require a run-time
setting. The simplest fix would be something like this:

=== modified file 'src/libCom/osi/os/posix/osdThread.c'
--- src/libCom/osi/os/posix/osdThread.c 2015-03-19 15:22:15 +0000
+++ src/libCom/osi/os/posix/osdThread.c 2016-01-29 20:41:08 +0000
@@ -362,7 +362,8 @@
         fprintf(stderr, "LRT: min priority: %d max priority %d\n",
             pcommonAttr->minPriority, pcommonAttr->maxPriority);
     }
-    if (pcommonAttr->maxPriority > pcommonAttr->minPriority) {
+    if (getenv("EPICS_RT_MLOCKALL") &&
+        pcommonAttr->maxPriority > pcommonAttr->minPriority) {
         status = mlockall(MCL_CURRENT | MCL_FUTURE);
         if(status) {
             fprintf(stderr, "Unable to lock the virtual address space
using mlockall\n");

That would require IOCs that need the memory locking to have set the
EPICS_RT_MLOCKALL environment variable before they are executed. A
slightly more complicated solution would allow locking to be turned on
at build-time in the configure/CONFIG_SITE_ENV file, but it could be
turned off again at run-time with an environment variable.

If you currently rely on the current mlockall() behaviour of Base and
wish to influence our decision, please speak up before we commit any
changes.

- Andrew

-- 
There are only two hard problems in distributed systems:
  2. Exactly-once delivery
  1. Guaranteed order of messages
  2. Exactly-once delivery
 -- Mathias Verraes

Replies:
RE: set-user-id root and EPICS 3.15 Mark Rivers
Re: set-user-id root and EPICS 3.15 Till Straumann
References:
set-user-id root and EPICS 3.15 Gerry Swislow
RE: set-user-id root and EPICS 3.15 Mark Rivers
Re: set-user-id root and EPICS 3.15 Ralph Lange

Navigate by Date:
Prev: Re: BOY Linking Container doesn't support OPI Search Path? Pearson, Matthew R.
Next: RE: set-user-id root and EPICS 3.15 Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: set-user-id root and EPICS 3.15 Ralph Lange
Next: RE: set-user-id root and EPICS 3.15 Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 15 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·