git: kernel - SWAP CACHE part 7/many - Add vm_swapcache.c core (write side)

Matthew Dillon dillon at
Thu Feb 4 15:20:43 PST 2010

commit 096e95c0a5baff85a63e1c94469fb3169dc7b081
Author: Matthew Dillon <dillon at>
Date:   Thu Feb 4 09:05:57 2010 -0800

    kernel - SWAP CACHE part 7/many - Add vm_swapcache.c core (write side)
    * Add vm_swapcache.c which will be responsible for assigning swap to clean
      vnode-backed VM pages and writing the data out.
      Implement a very simple inactive queue scanner and swap-writer for
    * Track swap space use, split up into the piece used for anonymous
      data and the piece used for clean vnode-backed data.
    * Add PG_SWAPPED tracking for newly allocated VM pages via
    * Conditionalize the swap code's dirtying/undirtying of VM pages.  We
      don't want to mess with the dirty state when working the swap
      cache since it isn't the definitive backing store for the VM page.

Summary of changes:
 sys/conf/files        |    1 +
 sys/vm/swap_pager.c   |   86 +++++++++++++-----
 sys/vm/swap_pager.h   |    3 +
 sys/vm/vm_page.c      |    6 ++
 sys/vm/vm_swapcache.c |  231 +++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 304 insertions(+), 23 deletions(-)
 create mode 100644 sys/vm/vm_swapcache.c

DragonFly BSD source repository

More information about the Commits mailing list