Print this page
re #13613 rb4516 Tunables needs volatile keyword

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/vm_pageout.c
          +++ new/usr/src/uts/common/os/vm_pageout.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  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  27   30  /*        All Rights Reserved   */
  28   31  
  29   32  /*
  30   33   * University Copyright- Copyright (c) 1982, 1986, 1988
  31   34   * The Regents of the University of California
  32   35   * All Rights Reserved
  33   36   *
  34   37   * University Acknowledgment- Portions of this document are derived from
↓ open down ↓ 33 lines elided ↑ open up ↑
  68   71  
  69   72  static int checkpage(page_t *, int);
  70   73  
  71   74  /*
  72   75   * The following parameters control operation of the page replacement
  73   76   * algorithm.  They are initialized to 0, and then computed at boot time
  74   77   * based on the size of the system.  If they are patched non-zero in
  75   78   * a loaded vmunix they are left alone and may thus be changed per system
  76   79   * using adb on the loaded system.
  77   80   */
  78      -pgcnt_t         slowscan = 0;
  79      -pgcnt_t         fastscan = 0;
       81 +volatile pgcnt_t        slowscan = 0;
       82 +volatile pgcnt_t        fastscan = 0;
  80   83  
  81      -static pgcnt_t  handspreadpages = 0;
       84 +volatile pgcnt_t        handspreadpages = 0;
  82   85  static int      loopfraction = 2;
  83   86  static pgcnt_t  looppages;
  84      -static int      min_percent_cpu = 4;
       87 +volatile int    min_percent_cpu = 4;
  85   88  static int      max_percent_cpu = 80;
  86   89  static pgcnt_t  maxfastscan = 0;
  87   90  static pgcnt_t  maxslowscan = 100;
  88   91  
  89      -pgcnt_t maxpgio = 0;
  90      -pgcnt_t minfree = 0;
  91      -pgcnt_t desfree = 0;
  92      -pgcnt_t lotsfree = 0;
       92 +volatile pgcnt_t        maxpgio = 0;
       93 +volatile pgcnt_t        minfree = 0;
       94 +volatile pgcnt_t        desfree = 0;
       95 +volatile pgcnt_t        lotsfree = 0;
  93   96  pgcnt_t needfree = 0;
  94      -pgcnt_t throttlefree = 0;
  95      -pgcnt_t pageout_reserve = 0;
       97 +volatile pgcnt_t        throttlefree = 0;
       98 +volatile pgcnt_t        pageout_reserve = 0;
  96   99  
  97  100  pgcnt_t deficit;
  98  101  pgcnt_t nscan;
  99  102  pgcnt_t desscan;
 100  103  
 101  104  /*
 102  105   * Values for min_pageout_ticks, max_pageout_ticks and pageout_ticks
 103  106   * are the number of ticks in each wakeup cycle that gives the
 104  107   * equivalent of some underlying %CPU duty cycle.
 105  108   * When RATETOSCHEDPAGING is 4,  and hz is 100, pageout_scanner is
↓ open down ↓ 1082 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX