git: kernel - Add flexibility to the RSS rlimit

Matthew Dillon dillon at crater.dragonflybsd.org
Wed Dec 28 14:18:45 PST 2016


commit 486b807a221da48a97f879876c53696f68ca20c7
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Wed Dec 28 14:07:02 2016 -0800

    kernel - Add flexibility to the RSS rlimit
    
    * Add sysctl vm.pageout_memuse_mode, defaulting to 1:
    
      0 - disable (behavior prior to memoryuse rlimit commits).  RLIMIT_RSS
          is ignored.  Pagedaemon operates normally based on global page
          queues.
    
      1 - passive mode (default).  Pagedaemon operates normally, but additional
          actions are taken for processes exceeding their RLIMIT_RSS.
    
          Enforces RSS on a per-process basis by removing pages from the pmap,
          but simply deactivates the page and does not synchronously free it
          or page it out to swap.  The deactivated pages are more likely to be
          cleaned out by the system by the pagedaemon verses what it would
          normally choose from the global page queues.
    
          This mode has the smoothest results for the process being limited,
          as well as a lower impact on actual paging to swap, but this mode
          has the similar impact on alloctable memory for other unrelated
          processes if the limited process continues to allocate large amounts
          of memory.
    
      2 - active mode.  Pagedaemon operates normally, but additional actions
          are taken for processes exceeding their RLIMIT_RSS.
    
          Enforces RSS on a per-process basis by actively freeing clean pages
          and actively paging out dirty pages.  This has the least impact on
          other unrelated processes but can cause the limited process to stall
          for short periods of time.  This mode has the least impact on
          allocatable memory.
    
          However, this mode can cause excessive paging to swap, and thus is
          not the default.

Summary of changes:
 sys/vm/vm_fault.c   |  3 ++-
 sys/vm/vm_pageout.c | 31 +++++++++++++++++++++----------
 sys/vm/vm_pageout.h |  1 +
 3 files changed, 24 insertions(+), 11 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/486b807a221da48a97f879876c53696f68ca20c7


-- 
DragonFly BSD source repository



More information about the Commits mailing list