git: kernel - Add vm.read_shortcut_enable

Matthew Dillon dillon at
Sat Sep 15 22:10:40 PDT 2012

commit 68ad14555b583c75f3d3605fd3b5aee7328a8af0
Author: Matthew Dillon <dillon at>
Date:   Sat Sep 15 20:52:45 2012 -0700

    kernel - Add vm.read_shortcut_enable
    * Add vm.read_shortcut_enable (disabled by default for now).  Set to 1 to
      enable this feature.
      This enables a helper function which HAMMER1 now uses to short-cut read()
      operations on files.  This feature only works on x86-64.
    * When enabled this feature allows file read() requests to be satisfied
      directly from the VM page cache using lwbuf's, completely bypassing the
      buffer cache and also bypassing most of the VFS's VOP_READ code.
      The result is an approximate doubling of read() performance in cases
      where the buffer cache is too small to fit the hot data set, but the VM
      page cache is not.
      This feature is able to avoid the buffer cache and thus prevent buffer
      cycling within it which, due to the constant installation and
      deinstallation of pages in KVM cause a great deal of SMP page table
      page invalidations.

Summary of changes:
 sys/cpu/x86_64/include/lwbuf.h |    3 +
 sys/kern/vfs_helper.c          |  122 ++++++++++++++++++++++++++++++++++++++++
 sys/kern/vfs_vnops.c           |    2 -
 sys/sys/mount.h                |    1 +
 sys/vfs/hammer/hammer_vnops.c  |   14 ++++-
 5 files changed, 139 insertions(+), 3 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list