Date: Tue, 16 May 2017 19:35:25 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r318367 - stable/11/sys/kern Message-ID: <201705161935.v4GJZPk0092555@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Tue May 16 19:35:25 2017 New Revision: 318367 URL: https://svnweb.freebsd.org/changeset/base/318367 Log: MFC r317784: cache: stop holding the ncneg_hot lock across purging Only non-hot entries are purged so the lock is not needed in the first place. This saves one lock/unlock pair. Modified: stable/11/sys/kern/vfs_cache.c Modified: stable/11/sys/kern/vfs_cache.c ============================================================================== --- stable/11/sys/kern/vfs_cache.c Tue May 16 19:03:26 2017 (r318366) +++ stable/11/sys/kern/vfs_cache.c Tue May 16 19:35:25 2017 (r318367) @@ -735,13 +735,12 @@ cache_negative_remove(struct namecache * list_locked = true; mtx_lock(&neglist->nl_lock); } - } else { - mtx_assert(&neglist->nl_lock, MA_OWNED); - mtx_assert(&ncneg_hot.nl_lock, MA_OWNED); } if (ncp->nc_flag & NCF_HOTNEGATIVE) { + mtx_assert(&ncneg_hot.nl_lock, MA_OWNED); TAILQ_REMOVE(&ncneg_hot.nl_list, ncp, nc_dst); } else { + mtx_assert(&neglist->nl_lock, MA_OWNED); TAILQ_REMOVE(&neglist->nl_list, ncp, nc_dst); } if (list_locked) @@ -816,7 +815,6 @@ cache_negative_zap_one(void) mtx_unlock(&ncneg_hot.nl_lock); mtx_lock(dvlp); rw_wlock(blp); - mtx_lock(&ncneg_hot.nl_lock); mtx_lock(&neglist->nl_lock); ncp2 = TAILQ_FIRST(&neglist->nl_list); if (ncp != ncp2 || dvlp != VP2VNODELOCK(ncp2->nc_dvp) || @@ -830,7 +828,6 @@ cache_negative_zap_one(void) cache_zap_locked(ncp, true); out_unlock_all: mtx_unlock(&neglist->nl_lock); - mtx_unlock(&ncneg_hot.nl_lock); rw_wunlock(blp); mtx_unlock(dvlp); out:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705161935.v4GJZPk0092555>