Print this page
2831 svc.startd and svc.configd waste memory.

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/svc/startd/startd.c
          +++ new/usr/src/cmd/svc/startd/startd.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  24   25   */
  25   26  
  26   27  /*
  27   28   * startd.c - the master restarter
  28   29   *
  29   30   * svc.startd comprises two halves.  The graph engine is based in graph.c and
  30   31   * maintains the service dependency graph based on the information in the
  31   32   * repository.  For each service it also tracks the current state and the
  32   33   * restarter responsible for the service.  Based on the graph, events from the
  33   34   * repository (mostly administrative requests from svcadm), and messages from
↓ open down ↓ 102 lines elided ↑ open up ↑
 136  137  
 137  138  static int finished = 0;
 138  139  static int opt_reconfig = 0;
 139  140  static uint8_t prop_reconfig = 0;
 140  141  
 141  142  #define INITIAL_REBIND_ATTEMPTS 5
 142  143  #define INITIAL_REBIND_DELAY    3
 143  144  
 144  145  pthread_mutexattr_t mutex_attrs;
 145  146  
      147 +#ifdef DEBUG
 146  148  const char *
 147  149  _umem_debug_init(void)
 148  150  {
 149  151          return ("default,verbose");     /* UMEM_DEBUG setting */
 150  152  }
 151  153  
 152  154  const char *
 153  155  _umem_logging_init(void)
 154  156  {
 155  157          return ("fail,contents");       /* UMEM_LOGGING setting */
 156  158  }
      159 +#endif
 157  160  
      161 +const char *
      162 +_umem_options_init(void)
      163 +{
      164 +        /*
      165 +         * To reduce our memory footprint, we set our UMEM_OPTIONS to indicate
      166 +         * that we do not wish to have per-CPU magazines -- if svc.startd is so
      167 +         * hot on CPU such that this becomes a scalability problem, there are
      168 +         * likely deeper things amiss...
      169 +         */
      170 +        return ("nomagazines");         /* UMEM_OPTIONS setting */
      171 +}
      172 +
 158  173  /*
 159  174   * startd_alloc_retry()
 160  175   *   Wrapper for allocation functions.  Retries with a decaying time
 161  176   *   value on failure to allocate, and aborts startd if failure is
 162  177   *   persistent.
 163  178   */
 164  179  void *
 165  180  startd_alloc_retry(void *f(size_t, int), size_t sz)
 166  181  {
 167  182          void *p;
↓ open down ↓ 770 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX