Print this page
    
13097 improve VM tunables for modern systems (fix mismerge)
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/uts/i86pc/sys/vm_machparam.h
          +++ new/usr/src/uts/i86pc/sys/vm_machparam.h
   1    1  /*
   2    2   * CDDL HEADER START
   3    3   *
   4    4   * The contents of this file are subject to the terms of the
   5    5   * Common Development and Distribution License (the "License").
   6    6   * You may not use this file except in compliance with the License.
   7    7   *
   8    8   * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9    9   * or http://www.opensolaris.org/os/licensing.
  10   10   * See the License for the specific language governing permissions
  11   11   * and limitations under the License.
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  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  /*      Copyright (c) 1988 AT&T */
  22   22  /*        All Rights Reserved   */
  23   23  /*
  24   24   * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  25   25   * Use is subject to license terms.
  26   26   * Copyright 2017 Joyent, Inc.
  27   27   */
  28   28  
  29   29  #ifndef _SYS_VM_MACHPARAM_H
  30   30  #define _SYS_VM_MACHPARAM_H
  31   31  
  32   32  #ifdef  __cplusplus
  33   33  extern "C" {
  34   34  #endif
  35   35  
  36   36  /*
  37   37   * Machine dependent constants for PC.
  38   38   */
  39   39  
  40   40  /*
  41   41   * USRTEXT is the start of the user text/data space.
  42   42   */
  43   43  #define USRTEXT         USRSTACK
  44   44  
  45   45  /*
  46   46   * Virtual memory related constants for UNIX resource control, all in bytes.
  47   47   * The default stack size (initial stack size limit) keeps the stack from
  48   48   * taking more than 2 page directory entries in addition to the part of
  49   49   * the page directory entry which also maps the initial text and data,
  50   50   * and makes the default slightly bigger than the 8MB on SPARC.
  51   51   */
  52   52  #ifdef __amd64
  53   53  /*
  54   54   * On amd64, the stack grows down from just below KERNELBASE (see the
  55   55   * definition of USERLIMIT in i86pc/sys/machparam.h). Theoretically,
  56   56   * it could grow down to the top of the VA hole (0xffff800000000000),
  57   57   * giving it a possible maximum of about 125T. For an amd64 xpv
  58   58   * kernel, all user VA space is below the VA hole. The theoretical
  59   59   * maximum for the stack is about the same, although it can't grow
  60   60   * to quite that size, since it would clash with the heap.
  61   61   *
  62   62   * Pick an upper limit that will work in both cases: 32T.
  63   63   *
  64   64   * For 32bit processes, the stack is below the text segment.
  65   65   */
  66   66  #define MAXSSIZ         (32ULL * 1024ULL * 1024ULL * 1024ULL * 1024ULL)
  67   67  #else
  68   68  #define MAXSSIZ         (USRSTACK - 1024*1024)
  69   69  #endif /* __amd64 */
  70   70  #define DFLSSIZ         (8*1024*1024 + ((USRSTACK) & 0x3FFFFF))
  71   71  
  72   72  /*
  73   73   * Size of the kernel segkmem system pte table.  This virtual
  74   74   * space is controlled by the resource map "kernelmap".
  75   75   */
  76   76  #define SYSPTSIZE       ((61*1024*1024) / MMU_PAGESIZE)
  77   77  
  78   78  /*
  79   79   * Size of the ethernet addressable kernel segkmem system pte table.
  80   80   * This virtual space is controlled by the resource map "ekernelmap".
  81   81   * The ethernet interfaces in some sun machines can address only
  82   82   * the upper 16 Megabytes of memory.  Since the ethernet
  83   83   * driver kmem_allocs its memory, we bias all kmem_allocs
  84   84   * to try ekernelmap first and if it fails try kernelmap.
  85   85   * Folks that allocate directly out of kernelmap, above,
  86   86   * get memory that is non-ethernet addressable.
  87   87   */
  88   88  #define E_SYSPTSIZE     (0x2000000 / MMU_PAGESIZE)
  89   89  
  90   90  /*
  91   91   * The virtual address space to be used by the seg_map segment
  92   92   * driver for fast kernel mappings.
  93   93   */
  94   94  #if defined(__i386)
  95   95  #define SEGMAPDEFAULT   (16 * 1024 * 1024)
  96   96  #define SEGMAPMAX       (128 * 1024 * 1024)
  97   97  #else
  98   98  #define SEGMAPDEFAULT   (64 * 1024 * 1024)
  99   99  #endif
 100  100  
 101  101  /*
 102  102   * The time for a process to be blocked before being very swappable.
 103  103   * This is a number of seconds which the system takes as being a non-trivial
 104  104   * amount of real time. You probably shouldn't change this;
 105  105   * it is used in subtle ways (fractions and multiples of it are, that is, like
 106  106   * half of a ``long time'', almost a long time, etc.)
 107  107   * It is related to human patience and other factors which don't really
 108  108   * change over time.
 109  109   */
 110  110  #define MAXSLP          20
 111  111  
 112  112  /*
 113  113   * A swapped in process is given a small amount of core without being bothered
 114  114   * by the page replacement algorithm. Basically this says that if you are
 115  115   * swapped in you deserve some resources. We protect the last SAFERSS
 116  116   * pages against paging and will just swap you out rather than paging you.
 117  117   * Note that each process has at least UPAGES pages which are not
 118  118   * paged anyways so this number just means a swapped in process is
 119  119   * given around 32k bytes.
 120  120   */
 121  121  /*
 122  122   * nominal ``small'' resident set size
  
    | 
      ↓ open down ↓ | 
    122 lines elided | 
    
      ↑ open up ↑ | 
  
 123  123   * protected against replacement
 124  124   */
 125  125  #define SAFERSS         3
 126  126  
 127  127  /*
 128  128   * DISKRPM is used to estimate the number of paging i/o operations
 129  129   * which one can expect from a single disk controller.
 130  130   *
 131  131   * XXX - The system doesn't account for multiple swap devices.
 132  132   */
 133      -#define DISKRPM         60
      133 +#define DISKRPM         600
 134  134  
 135  135  /*
 136  136   * The maximum value for handspreadpages which is the the distance
 137  137   * between the two clock hands in pages. This is only used when the page
 138  138   * scanner is first started.
 139  139   */
 140  140  #define MAXHANDSPREADPAGES      ((64 * 1024 * 1024) / PAGESIZE)
 141  141  
 142  142  /*
 143  143   * Paged text files that are less than PGTHRESH bytes
 144  144   * may be "prefaulted in" instead of demand paged.
 145  145   */
 146  146  #define PGTHRESH        (280 * 1024)
 147  147  
 148  148  #ifdef  __cplusplus
 149  149  }
 150  150  #endif
 151  151  
 152  152  #endif  /* _SYS_VM_MACHPARAM_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX