Print this page
re #13613 rb4516 Tunables needs volatile keyword

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/sctp/sctp_misc.c
          +++ new/usr/src/uts/common/inet/sctp/sctp_misc.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) 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  24   25   */
  25   26  
  26   27  #include <sys/types.h>
       28 +#include <sys/vmsystm.h>
  27   29  #include <inet/common.h>
  28   30  #include "sctp_impl.h"
  29   31  
  30   32  /* Control whether SCTP can enter defensive mode when under memory pressure. */
  31   33  static boolean_t sctp_do_reclaim = B_TRUE;
  32   34  
  33   35  static void     sctp_reclaim_timer(void *);
  34   36  
  35   37  /* Diagnostic routine used to return a string associated with the sctp state. */
  36   38  char *
↓ open down ↓ 110 lines elided ↑ open up ↑
 147  149  
 148  150  /*
 149  151   * Timeout function to reset the SCTP stack variable sctps_reclaim to false.
 150  152   */
 151  153  static void
 152  154  sctp_reclaim_timer(void *arg)
 153  155  {
 154  156          sctp_stack_t *sctps = (sctp_stack_t *)arg;
 155  157          int64_t tot_assoc = 0;
 156  158          int i;
 157      -        extern pgcnt_t lotsfree, needfree;
 158  159  
 159  160          for (i = 0; i < sctps->sctps_sc_cnt; i++)
 160  161                  tot_assoc += sctps->sctps_sc[i]->sctp_sc_assoc_cnt;
 161  162  
 162  163          /*
 163  164           * This happens only when a stack is going away.  sctps_reclaim_tid
 164  165           * should not be reset to 0 when returning in this case.
 165  166           */
 166  167          mutex_enter(&sctps->sctps_reclaim_lock);
 167  168          if (!sctps->sctps_reclaim) {
↓ open down ↓ 20 lines elided ↑ open up ↑
 188  189   * progress, meaning retransmitting for shorter time (sctp_pa_early_abort/
 189  190   * sctp_pp_early_abort number of strikes).
 190  191   */
 191  192  /* ARGSUSED */
 192  193  void
 193  194  sctp_conn_reclaim(void *arg)
 194  195  {
 195  196          netstack_handle_t nh;
 196  197          netstack_t *ns;
 197  198          sctp_stack_t *sctps;
 198      -        extern pgcnt_t lotsfree, needfree;
 199  199  
 200  200          if (!sctp_do_reclaim)
 201  201                  return;
 202  202  
 203  203          /*
 204  204           * The reclaim function may be called even when the system is not
 205  205           * really under memory pressure.
 206  206           */
 207  207          if (freemem >= lotsfree + needfree)
 208  208                  return;
↓ open down ↓ 69 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX