Date: Thu, 15 Oct 2020 17:42:22 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366734 - head/sys/kern Message-ID: <202010151742.09FHgMfe012786@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Thu Oct 15 17:42:22 2020 New Revision: 366734 URL: https://svnweb.freebsd.org/changeset/base/366734 Log: cache: make neglist an array given the static size Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Oct 15 17:40:02 2020 (r366733) +++ head/sys/kern/vfs_cache.c Thu Oct 15 17:42:22 2020 (r366734) @@ -305,17 +305,18 @@ SYSCTL_BOOL(_vfs, OID_AUTO, cache_fast_revlookup, CTLF static struct mtx __exclusive_cache_line ncneg_shrink_lock; +#define ncneghash 3 +#define numneglists (ncneghash + 1) + struct neglist { struct mtx nl_lock; TAILQ_HEAD(, namecache) nl_list; } __aligned(CACHE_LINE_SIZE); -static struct neglist __read_mostly *neglists; +static struct neglist neglists[numneglists]; static struct neglist ncneg_hot; static u_long numhotneg; -#define ncneghash 3 -#define numneglists (ncneghash + 1) static inline struct neglist * NCP2NEGLIST(struct namecache *ncp) { @@ -2091,8 +2092,6 @@ nchinit(void *dummy __unused) for (i = 0; i < numvnodelocks; i++) mtx_init(&vnodelocks[i], "ncvn", NULL, MTX_DUPOK | MTX_RECURSE); - neglists = malloc(sizeof(*neglists) * numneglists, M_VFSCACHE, - M_WAITOK | M_ZERO); for (i = 0; i < numneglists; i++) { mtx_init(&neglists[i].nl_lock, "ncnegl", NULL, MTX_DEF); TAILQ_INIT(&neglists[i].nl_list);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010151742.09FHgMfe012786>