git: kernel - Rewrite do_vmtotal and change the way VM statistics are collected

Matthew Dillon dillon at crater.dragonflybsd.org
Sun Oct 6 19:01:16 PDT 2013


commit 6d538b476425b98b7d28d50562ab45c9a9949911
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sun Oct 6 18:50:36 2013 -0700

    kernel - Rewrite do_vmtotal and change the way VM statistics are collected
    
    * The vmtotal sysctl was iterating through all VM objects.  This is a
      problem on machines with huge amounts of memory which might have millions
      of VM objects.
    
    * Collect running VM statistics in the swap pager and vm_page modules,
      on a per-cpu basis.  Add a struct vmtotal structure to globaldata.
    
      Active real memory use is how many VM pages are mapped to processes.
    
      Total real memory use is how many VM pages are allocated whether they
      are mapped to processes or not.
    
      Shared real memory use represents VM pages mapped to more than one process.
    
      Total virtual memory use uses total real memory plus allocated swap space.
    
      Remaining fields are left 0 and not currently supported.
    
    * Represents a more realistic view of memmory and VM.  In particular,
      totalling up the file sizes for all mmap()'d files is no longer a
      collected statistic because the system really has no way of knowing
      how little or how much of the file is 'active', or even ever accessed.
    
    * The vmtotal sysctl (e.g. used by systat -vm 1) now just iterates
      cpus to aggregate gd_vmtotal for VM statistics.  This is basically
      O(1) for VM statistics.  It still iterates processes (which we will
      want to fix too, eventually), but the main scaling issue was with VM
      objects and that has been fixed.

Summary of changes:
 sys/platform/pc64/include/pmap.h |   3 +-
 sys/platform/pc64/x86_64/pmap.c  |  35 +++++++++--
 sys/sys/globaldata.h             |   1 +
 sys/sys/vmmeter.h                |   3 +-
 sys/vm/swap_pager.c              |   8 ++-
 sys/vm/vm_meter.c                | 125 +++++++++------------------------------
 sys/vm/vm_page.c                 |   6 +-
 7 files changed, 74 insertions(+), 107 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/6d538b476425b98b7d28d50562ab45c9a9949911


-- 
DragonFly BSD source repository



More information about the Commits mailing list