git: kernel - Attempt to fix high vnlru cpu use

Matthew Dillon dillon at
Mon Mar 19 18:44:24 PDT 2018

commit e83d5c121c899edad9e4cab9fee4465c6d39d04c
Author: Matthew Dillon <dillon at>
Date:   Mon Mar 19 18:39:21 2018 -0700

    kernel - Attempt to fix high vnlru cpu use
    * In certain situations _cache_cleanpos() gets into a livelock
      of some sort.  It is limited by a counter but the livelock creates
      havoc when it happens.
    * It appears that _cache_cleanpos() can get into a situation where
      the head element of all available nchashtbl[] slots is not freeable
      (e.g. due to having multiple refs).  When this occurs, trailing
      elements in the chained hash table cannot be recycled.
      nchashtbl[] is typically very large, so this situation does not
      happen very often.  There are usually plenty of entries to pick
      away at.  However, it looks like situations can develop where
      enough entries get into this masked state that the hysteresis is
      unable to complete, resulting in a cpubound loop.
    * Refactor the chained list from LIST to TAILQ and modify the
      _cache_cleanpos() function to cycle ncp's to the end of the
      list before trying to zap them.  If the zap fails, the next
      iteration will encounter a different head.
    Reported-by: ftigeot

Summary of changes:
 sys/kern/vfs_cache.c | 52 ++++++++++++++++++++++++++++++++++------------------
 sys/sys/namecache.h  |  2 +-
 2 files changed, 35 insertions(+), 19 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list