git: kernel - Fix a case in the path lookup that results in high latencies

Matthew Dillon dillon at crater.dragonflybsd.org
Fri Jun 7 15:18:31 PDT 2013


commit 737097c0593fb0012be0369c8ce128934c37b94a
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Fri Jun 7 15:13:21 2013 -0700

    kernel - Fix a case in the path lookup that results in high latencies
    
    * When many cpu cores are looking up paths with matching components,
      so as when doing a parallel buildworld or a parallel build of
      /usr/src/lib/libc, the namecache's shared/exclusive lock mechanic
      can break-down and create a chain-reaction of exclusive locks which
      destroys performance.
    
    * When attempting to get a shared lock we were previously backing-down to
      an exclusive lock if the shared lock could not be obtained non-blocking.
      The original code could cause a chain-reaction of unnecessary exclusive
      locks.
    
      Instead, we now only back-down to an exclusive lock only if the current
      thread already holds an exclusive lock on the same namecache entry
      or if we detect that another thread is trying to get an exclusive lock.
      Otherwise we fall-through and obtain the shared lock in a blocking manner.
    
    Reported-by: ftigeot

Summary of changes:
 sys/kern/vfs_cache.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/737097c0593fb0012be0369c8ce128934c37b94a


-- 
DragonFly BSD source repository



More information about the Commits mailing list