Print this page
re #13613 rb4516 Tunables needs volatile keyword

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/swapfs/swap_subr.c
          +++ new/usr/src/uts/common/fs/swapfs/swap_subr.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  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   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
       25 +/*
       26 + * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
       27 + */
  25   28  
  26   29  #include <sys/types.h>
  27   30  #include <sys/param.h>
  28   31  #include <sys/systm.h>
  29   32  #include <sys/errno.h>
  30   33  #include <sys/kmem.h>
  31   34  #include <sys/vnode.h>
  32   35  #include <sys/vfs_opreg.h>
  33   36  #include <sys/swap.h>
  34   37  #include <sys/sysmacros.h>
↓ open down ↓ 15 lines elided ↑ open up ↑
  50   53   * means that swapfs can only grow to availrmem - swapfs_minfree.  This
  51   54   * can be set as just constant value or a certain percentage of installed
  52   55   * physical memory. It is set in swapinit().
  53   56   *
  54   57   * Users who want to change the amount of memory that can be used as swap
  55   58   * space should do so by setting swapfs_desfree at boot time,
  56   59   * not swapfs_minfree.
  57   60   */
  58   61  
  59   62  pgcnt_t swapfs_desfree = 0;
  60      -pgcnt_t swapfs_minfree = 0;
  61      -pgcnt_t swapfs_reserve = 0;
       63 +volatile pgcnt_t swapfs_minfree = 0;
       64 +volatile pgcnt_t swapfs_reserve = 0;
  62   65  
  63   66  #ifdef SWAPFS_DEBUG
  64   67  int swapfs_debug;
  65   68  #endif /* SWAPFS_DEBUG */
  66   69  
  67   70  
  68   71  static int swapfs_vpcount;
  69   72  static kmutex_t swapfs_lock;
  70   73  static struct async_reqs *sw_ar, *sw_pendlist, *sw_freelist;
  71   74  
↓ open down ↓ 337 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX