EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Redundancy Patch: configure
From: Andrew Johnson <[email protected]>
To: EPICS core-talk <[email protected]>
Date: Fri, 16 Nov 2007 16:51:50 -0600
Andrew Johnson wrote:
**************
Modified
**************

# configuration
(1) for Linux, modify the related file in base/configure/os
    OSITHREAD_USE_DEFAULT_STACK = YES

Including the above change in Base will significantly increase the
stack size for most epicsThreads and severly reduce the number of IOCs
that a CA client such as the CA nameserver or PV Gateway can
simultaneously connect to, which is unacceptable.  The reasoning is as
follows:

* Without the above change, each thread is explicitly given one of
  three generically named stack sizes ('small', 'medium' or 'big').
  The absolute size of these stacks can be configured by OS-specific
  code, and for Posix-based systems like Linux the largest stack is
  usually 512 KBytes.

* For Fedora Core 6 the default stack size is 10240 KBytes = 10 MBytes
  (run 'limit' to find this value which may be different on different
  Linux distributions).  Even though the memory for a thread's stack
  will be allocated sparsely, the OS enforces this spacing between
  threads since it is not possible to move a stack after the thread
  has started.

* On a 32-bit CPU, the User-mode memory space of any process can fill
  at most half the 32-bit address space, i.e. 2 GBytes = 2048 MBytes.

* The CA client library creates 2 threads per TCP circuit, thus
  requiring 20 MBytes of address space per IOC with the default stack
  size but only 768 KBytes when variable sizes are allowed.

* A simple division shows that using the default stack size, no CA
  client can connect to more than just over 100 IOCs simultaneously.
  This is unacceptable since many sites now have more than this number
  of IOCs and commonly need CA clients to be able to connect to a
  majority of the site's IOCs.

If the EPICS stack sizes are too small for use with the RMT they can be
increased by changing a table in src/libCom/osi/os/posix/osdThread.c
instead of using the above setting.


    OP_SYS_CFLAGS += -rdynamic
    OP_SYS_LDFLAGS += -export-dynamic
    OP_SYS_LDLIBS += -ldl

The above are provided to support epicsFindSymbol(), which is used in
the patched versions of src/db/dbScan.c and src/rsrv/caservertask.c to
look for the redundancy routine rmtRegister().  There are better ways
to do this; see my discussion on the other patches.


(2) for darwin, modify the related file in base/configure/os
    OSITHREAD_USE_DEFAULT_STACK = YES

See above argument about increasing thread stack sizes, although I
don't know what the defaults are on Darwin.


(3) for solaris, modify the related file in base/configure/os
    OP_SYS_LDLIBS += -ldl

See epicsFindSymbol() comment above.

- Andrew
--
When a distinguished but elderly scientist states that something is
possible, he is almost certainly right.  When he states that something
is impossible, he is very probably wrong.  -- Arthur C. Clarke

Replies:
Re: Redundancy Patch: configure Liu, Gongfa
References:
Redundancy Patch: configure Andrew Johnson

Navigate by Date:
Prev: epicsThreadDelete Re: Redundancy Patches Kay-Uwe Kasemir
Next: Re: Redundancy Patch: iocsh Andrew Johnson
Index: 2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Redundancy Patch: configure Andrew Johnson
Next: Re: Redundancy Patch: configure Liu, Gongfa
Index: 2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·