From owner-svn-src-head@freebsd.org Sat Jan 11 22:56:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C634F1F7608; Sat, 11 Jan 2020 22:56:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47wFZs4vT7z4bDB; Sat, 11 Jan 2020 22:56:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89E75A1A0; Sat, 11 Jan 2020 22:56:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00BMuLnT090007; Sat, 11 Jan 2020 22:56:21 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00BMuKI3090003; Sat, 11 Jan 2020 22:56:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001112256.00BMuKI3090003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 11 Jan 2020 22:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356642 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 356642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jan 2020 22:56:21 -0000 Author: mjg Date: Sat Jan 11 22:56:20 2020 New Revision: 356642 URL: https://svnweb.freebsd.org/changeset/base/356642 Log: vfs: incomplete pass at converting more ints to u_long Most notably numvnodes and freevnodes were u_long, but parameters used to govern them remained as ints. Modified: head/sys/kern/vfs_cache.c head/sys/kern/vfs_hash.c head/sys/kern/vfs_subr.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Jan 11 22:55:12 2020 (r356641) +++ head/sys/kern/vfs_cache.c Sat Jan 11 22:56:20 2020 (r356642) @@ -1979,13 +1979,13 @@ nchinit(void *dummy __unused) SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nchinit, NULL); void -cache_changesize(int newmaxvnodes) +cache_changesize(u_long newmaxvnodes) { struct nchashhead *new_nchashtbl, *old_nchashtbl; u_long new_nchash, old_nchash; struct namecache *ncp; uint32_t hash; - int newncsize; + u_long newncsize; int i; newncsize = newmaxvnodes * ncsizefactor; Modified: head/sys/kern/vfs_hash.c ============================================================================== --- head/sys/kern/vfs_hash.c Sat Jan 11 22:55:12 2020 (r356641) +++ head/sys/kern/vfs_hash.c Sat Jan 11 22:56:20 2020 (r356642) @@ -199,7 +199,7 @@ vfs_hash_rehash(struct vnode *vp, u_int hash) } void -vfs_hash_changesize(int newmaxvnodes) +vfs_hash_changesize(u_long newmaxvnodes) { struct vfs_hash_head *vfs_hash_newtbl, *vfs_hash_oldtbl; u_long vfs_hash_newmask, vfs_hash_oldmask; Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Jan 11 22:55:12 2020 (r356641) +++ head/sys/kern/vfs_subr.c Sat Jan 11 22:56:20 2020 (r356642) @@ -310,20 +310,21 @@ static enum { SYNCER_RUNNING, SYNCER_SHUTTING_DOWN, SY syncer_state; /* Target for maximum number of vnodes. */ -int desiredvnodes; -static int gapvnodes; /* gap between wanted and desired */ -static int vhiwat; /* enough extras after expansion */ -static int vlowat; /* minimal extras before expansion */ -static int vstir; /* nonzero to stir non-free vnodes */ +u_long desiredvnodes; +static u_long gapvnodes; /* gap between wanted and desired */ +static u_long vhiwat; /* enough extras after expansion */ +static u_long vlowat; /* minimal extras before expansion */ +static u_long vstir; /* nonzero to stir non-free vnodes */ static volatile int vsmalltrigger = 8; /* pref to keep if > this many pages */ static int sysctl_update_desiredvnodes(SYSCTL_HANDLER_ARGS) { - int error, old_desiredvnodes; + u_long old_desiredvnodes; + int error; old_desiredvnodes = desiredvnodes; - if ((error = sysctl_handle_int(oidp, arg1, arg2, req)) != 0) + if ((error = sysctl_handle_long(oidp, arg1, arg2, req)) != 0) return (error); if (old_desiredvnodes != desiredvnodes) { wantfreevnodes = desiredvnodes / 4; @@ -336,7 +337,7 @@ sysctl_update_desiredvnodes(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_kern, KERN_MAXVNODES, maxvnodes, CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, &desiredvnodes, 0, - sysctl_update_desiredvnodes, "I", "Target for maximum number of vnodes"); + sysctl_update_desiredvnodes, "UL", "Target for maximum number of vnodes"); SYSCTL_ULONG(_kern, OID_AUTO, minvnodes, CTLFLAG_RW, &wantfreevnodes, 0, "Old name for vfs.wantfreevnodes (legacy)"); static int vnlru_nowhere; @@ -459,7 +460,7 @@ PCTRIE_DEFINE(BUF, buf, b_lblkno, buf_trie_alloc, buf_ * grows, the ratio of the memory size in KB to vnodes approaches 64:1. */ #ifndef MAXVNODES_MAX -#define MAXVNODES_MAX (512 * 1024 * 1024 / 64) /* 8M */ +#define MAXVNODES_MAX (512UL * 1024 * 1024 / 64) /* 8M */ #endif static MALLOC_DEFINE(M_VNODE_MARKER, "vnodemarker", "vnode marker"); @@ -582,7 +583,7 @@ vntblinit(void *dummy __unused) desiredvnodes = min(physvnodes, virtvnodes); if (desiredvnodes > MAXVNODES_MAX) { if (bootverbose) - printf("Reducing kern.maxvnodes %d -> %d\n", + printf("Reducing kern.maxvnodes %lu -> %lu\n", desiredvnodes, MAXVNODES_MAX); desiredvnodes = MAXVNODES_MAX; } Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sat Jan 11 22:55:12 2020 (r356641) +++ head/sys/sys/vnode.h Sat Jan 11 22:56:20 2020 (r356642) @@ -434,7 +434,7 @@ extern int vttoif_tab[]; */ extern struct vnode *rootvnode; /* root (i.e. "/") vnode */ extern struct mount *rootdevmp; /* "/dev" mount */ -extern int desiredvnodes; /* number of vnodes desired */ +extern u_long desiredvnodes; /* number of vnodes desired */ extern struct uma_zone *namei_zone; extern struct vattr va_null; /* predefined null vattr structure */ @@ -607,7 +607,7 @@ typedef int (*vn_get_ino_t)(struct mount *, void *, in int bnoreuselist(struct bufv *bufv, struct bufobj *bo, daddr_t startn, daddr_t endn); /* cache_* may belong in namei.h. */ -void cache_changesize(int newhashsize); +void cache_changesize(u_long newhashsize); #define cache_enter(dvp, vp, cnp) \ cache_enter_time(dvp, vp, cnp, NULL, NULL) void cache_enter_time(struct vnode *dvp, struct vnode *vp, @@ -924,7 +924,7 @@ int fifo_printinfo(struct vnode *); /* vfs_hash.c */ typedef int vfs_hash_cmp_t(struct vnode *vp, void *arg); -void vfs_hash_changesize(int newhashsize); +void vfs_hash_changesize(u_long newhashsize); int vfs_hash_get(const struct mount *mp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); u_int vfs_hash_index(struct vnode *vp);