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/i86pc/os/trap.c
          +++ new/usr/src/uts/i86pc/os/trap.c
↓ open down ↓ 483 lines elided ↑ open up ↑
 484  484          size_t sz;
 485  485          int ta;
 486  486  #ifdef __amd64
 487  487          uchar_t instr;
 488  488  #endif
 489  489  
 490  490          ASSERT_STACK_ALIGNED();
 491  491  
 492  492          type = rp->r_trapno;
 493  493          CPU_STATS_ADDQ(CPU, sys, trap, 1);
 494      -        ASSERT(ct->t_schedflag & TS_DONT_SWAP);
 495  494  
 496  495          if (type == T_PGFLT) {
 497  496  
 498  497                  errcode = rp->r_err;
 499  498                  if (errcode & PF_ERR_WRITE)
 500  499                          rw = S_WRITE;
 501  500                  else if ((caddr_t)rp->r_pc == addr ||
 502  501                      (mmu.pt_nx != 0 && (errcode & PF_ERR_EXEC)))
 503  502                          rw = S_EXEC;
 504  503                  else
↓ open down ↓ 1750 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX