Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sys



Module Name:    src
Committed By:   ad
Date:           Sun Dec  1 13:39:53 UTC 2019

Modified Files:
        src/sys/kern: vfs_cache.c
        src/sys/rump/include/rump: rump_namei.h
        src/sys/sys: namei.h namei.src

Log Message:
namecache changes:

- Delete the per-entry lock, and borrow the associated vnode's v_interlock
  instead.  We need to acquire it during lookup anyway.  We can revisit this
  in the future but for now it's a stepping stone, and works within the
  quite limited context of what we have (BSD namecache/lookup design).

- Implement an idea that Mateusz Guzik (mjg%FreeBSD.org@localhost) gave me.  In
  cache_reclaim(), we don't need to lock out all of the CPUs to garbage
  collect entries.  All we need to do is observe their locks unheld at least
  once: then we know they are not in the critical section, and no longer
  have visibility of the entries about to be garbage collected.

- The above makes it safe for sysctl to take only namecache_lock to get stats,
  and we can remove all the crap dealing with per-CPU locks.

- For lockstat, make namecache_lock a static now we have __cacheline_aligned.

- Avoid false sharing - don't write back to nc_hittime unless it has changed.
  Put a a comment in place explaining this.  Pretty sure this was there in
  2008/2009 but someone removed it (understandably, the code looks weird).

- Use a mutex to protect the garbage collection queue instead of atomics, and
  adjust the low water mark up so that cache_reclaim() isn't doing so much
  work at once.


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/kern/vfs_cache.c
cvs rdiff -u -r1.33 -r1.34 src/sys/rump/include/rump/rump_namei.h
cvs rdiff -u -r1.99 -r1.100 src/sys/sys/namei.h
cvs rdiff -u -r1.43 -r1.44 src/sys/sys/namei.src

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index