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); _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"