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/mlsetup.c
          +++ new/usr/src/uts/i86pc/os/mlsetup.c
↓ open down ↓ 269 lines elided ↑ open up ↑
 270  270          if (is_x86_feature(x86_featureset, X86FSET_DE))
 271  271                  setcr4(getcr4() | CR4_DE);
 272  272  #endif /* __xpv */
 273  273  
 274  274          /*
 275  275           * initialize t0
 276  276           */
 277  277          t0.t_stk = (caddr_t)rp - MINFRAME;
 278  278          t0.t_stkbase = t0stack;
 279  279          t0.t_pri = maxclsyspri - 3;
 280      -        t0.t_schedflag = TS_LOAD | TS_DONT_SWAP;
      280 +        t0.t_schedflag = 0;
 281  281          t0.t_procp = &p0;
 282  282          t0.t_plockp = &p0lock.pl_lock;
 283  283          t0.t_lwp = &lwp0;
 284  284          t0.t_forw = &t0;
 285  285          t0.t_back = &t0;
 286  286          t0.t_next = &t0;
 287  287          t0.t_prev = &t0;
 288  288          t0.t_cpu = cpu[0];
 289  289          t0.t_disp_queue = &cpu0_disp;
 290  290          t0.t_bind_cpu = PBIND_NONE;
↓ open down ↓ 208 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX