git: tmpfs - Change paging behavior, fix two directory-entry races

Matthew Dillon dillon at crater.dragonflybsd.org
Wed Apr 22 21:20:35 PDT 2020


commit 307bf7669c3778cc1b7176aff7485b448eaca928
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Wed Apr 22 19:24:13 2020 -0700

    tmpfs - Change paging behavior, fix two directory-entry races
    
    * Change the paging behavior for vfs.tmpfs.bufcache_mode.
    
      These changes try to reduce unnecessary tmpfs flushes to swap when
      the pageout daemon is able to locate sufficient clean VM pages.
      The pageout daemon can still page tmpfs data to swap via its normal
      operation, but tmpfs itself will not force write()s to pipeline to
      swap unless memory pressure is severe.
    
      0	tmpfs write()s are pipelined to swap via the buffer cache only
    	if the VM system is below the minimum free page count.
    
    	(this is the new default)
    
      1	tmpfs write()s are pipelined to swap via the buffer cache when
    	the VM system is paging.
    
      2	Same as (1) but be more aggressive about releasing buffer cache
    	buffers.
    
      3	tmpfs_write()s are always pipelined to swap via the buffer cache,
    	regardless.
    
    * Fix tmpfs file creation, hard-linking, and rename to ensure that the
      new file is not created in a deleted directory.  We must lock the
      directory node around existing tests and add checks that were missing.
    
      Also remove a few unnecessary recursive locks.

Summary of changes:
 sys/vfs/tmpfs/tmpfs.h        |  4 ++--
 sys/vfs/tmpfs/tmpfs_subr.c   | 33 +++++++++++++++++----------
 sys/vfs/tmpfs/tmpfs_vfsops.c |  2 +-
 sys/vfs/tmpfs/tmpfs_vnops.c  | 54 ++++++++++++++++++++++++++++++--------------
 4 files changed, 61 insertions(+), 32 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/307bf7669c3778cc1b7176aff7485b448eaca928


-- 
DragonFly BSD source repository


More information about the Commits mailing list