Print this page
remove whole-process swapping
Long before Unix supported paging, it used process swapping to reclaim
memory.  The code is there and in theory it runs when we get *extremely* low
on memory.  In practice, it never runs since the definition of low-on-memory
is antiquated. (XXX: define what antiquated means)
You can check the number of swapout/swapin events with kstats:
$ kstat -p ::vm:swapin ::vm:swapout

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sparc/v9/vm/seg_nf.c
          +++ new/usr/src/uts/sparc/v9/vm/seg_nf.c
↓ open down ↓ 23 lines elided ↑ open up ↑
  24   24   */
  25   25  
  26   26  /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
  27   27  /* All Rights Reserved */
  28   28  
  29   29  /*
  30   30   * Portions of this source code were derived from Berkeley 4.3 BSD
  31   31   * under license from the Regents of the University of California.
  32   32   */
  33   33  
  34      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  35      -
  36   34  /*
  37   35   * VM - segment for non-faulting loads.
  38   36   */
  39   37  
  40   38  #include <sys/types.h>
  41   39  #include <sys/t_lock.h>
  42   40  #include <sys/param.h>
  43   41  #include <sys/mman.h>
  44   42  #include <sys/errno.h>
  45   43  #include <sys/kmem.h>
↓ open down ↓ 44 lines elided ↑ open up ↑
  90   88          segnf_unmap,
  91   89          segnf_free,
  92   90          (faultcode_t (*)(struct hat *, struct seg *, caddr_t, size_t,
  93   91              enum fault_type, enum seg_rw))
  94   92                  segnf_nomap,            /* fault */
  95   93          (faultcode_t (*)(struct seg *, caddr_t))
  96   94                  segnf_nomap,            /* faulta */
  97   95          segnf_setprot,
  98   96          segnf_checkprot,
  99   97          (int (*)())segnf_badop,         /* kluster */
 100      -        (size_t (*)(struct seg *))NULL, /* swapout */
 101   98          (int (*)(struct seg *, caddr_t, size_t, int, uint_t))
 102   99                  segnf_nop,              /* sync */
 103  100          (size_t (*)(struct seg *, caddr_t, size_t, char *))
 104  101                  segnf_nop,              /* incore */
 105  102          (int (*)(struct seg *, caddr_t, size_t, int, int, ulong_t *, size_t))
 106  103                  segnf_nop,              /* lockop */
 107  104          segnf_getprot,
 108  105          segnf_getoffset,
 109  106          segnf_gettype,
 110  107          segnf_getvp,
↓ open down ↓ 388 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX