From nobody Sun Feb 13 13:07:21 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C81F119BCA7C; Sun, 13 Feb 2022 13:07:22 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JxSLf2yqRz3JHx; Sun, 13 Feb 2022 13:07:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644757642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JcBwmZsReKuXXEuJpGQNDqK5Yync0A79yShctKfh57A=; b=auZHnLfVrowQPEJWuTVkTuXwZyuAxZXwPzKnKyXe2X/tAixgjzYeEUYJ1oC4zB3lLW4SGr TjX4ABBNiSp8mqR1OL0pfFNBQzVmkwuI/RAdZdECgesvJ2hax4ij/Ii14k521RMwzZUDTv sf+E4j0KHk1PxUBLkiG2aVjkapw+S/J4UIZfVdWHiCXKLgPHHgdL4dyn+Fx8xRKgzXz/Oc piIqc9HhpIr7+ObKS7BrX/ltFeXYeTVtHWCFGHE6BVqG0hI2epJDPWxSeKCCfPwXO5qjwe YpOumjDT01ihFDZcgXNgpUej79j3rGIGJq3UoXQYTsGJhdV7e8WPHBCCkOyGLA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1153F1BD8A; Sun, 13 Feb 2022 13:07:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21DD7LSp074087; Sun, 13 Feb 2022 13:07:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21DD7L88074086; Sun, 13 Feb 2022 13:07:21 GMT (envelope-from git) Date: Sun, 13 Feb 2022 13:07:21 GMT Message-Id: <202202131307.21DD7L88074086@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 6aa246e605b9 - main - vfs: convert vnsz2log to a macro List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6aa246e605b9528b23aaedf4b051b4672fb28829 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644757642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JcBwmZsReKuXXEuJpGQNDqK5Yync0A79yShctKfh57A=; b=Ise+Y7JfsGTw0kAleRqk78KVTxjIqXTiRfy+35ml3IWqIK0UrkhjtWSdrJ99nui/Cnb9nT aJcgky4YSKM4+6Vc+v0rqZnhxJaiKT0P/L/KxL1TbImR3uk+a07//rgc3k/mII0mg2NvMc b7KSH4205JcuULqFWQ2Hq4YRR20DY+G7WFQbfla4Z/4l8OE56W6HsdL0K7Zj30I/vWgGS+ nMOvhio1htoSV37pfTCm/RtYs0dnar2IE1cYl3zKbseu+otSDQGgQ4hgGtR6uMkQMmTJ8M KjqPIU7oh/cbMqf5dameNQOIdH8Aj0BCWrZikRgnZdfIHkfYUuj0s4YB7faI2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644757642; a=rsa-sha256; cv=none; b=U7y4zQijTUW3EtgJheKrdpJKJRv3KXK1XiHlgcFo8EKbLtqUyz3CkIYvi3suR+y5uRfu4D MF2XpC/WiE0xTKzz0M9HWqHQGqGge82oglxDcWhSaC1x1FJMJXdTROsg/rSO6SFLCMfrfA Ti+4AXXk0CLjjZ2qPOT+iKf+ExBZfgM4nBe1fUSn5h2e0i/yOkfT4AIHfNPsTDNPNb8kjO /P+mZW23LaM9/F06Yj0Y8XwGSHqC03ZqYcf//JPUUb3dr69KSXw8nUBqVyyhde1MeGZYh0 CI1wHLsMaatWpbrJUW2VnRXG9H5DZgi1Sqk9be6tOwWu41SmmA2/WNWkSUSAAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=6aa246e605b9528b23aaedf4b051b4672fb28829 commit 6aa246e605b9528b23aaedf4b051b4672fb28829 Author: Mateusz Guzik AuthorDate: 2022-02-12 20:26:34 +0000 Commit: Mateusz Guzik CommitDate: 2022-02-13 13:07:08 +0000 vfs: convert vnsz2log to a macro --- sys/kern/vfs_subr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 94748a4a4858..56efe0367c03 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -460,7 +460,11 @@ SYSCTL_PROC(_debug, OID_AUTO, ftry_reclaim_vnode, "Try to reclaim a vnode by its file descriptor"); /* Shift count for (uintptr_t)vp to initialize vp->v_hash. */ -static int vnsz2log; +#define vnsz2log 8 +#ifndef DEBUG_LOCKS +_Static_assert((sizeof(struct vnode) >= 256) && (sizeof(struct vnode) < 512), + "vnsz2log needs to be updated"); +#endif /* * Support for the bufobj clean & dirty pctrie. @@ -657,7 +661,6 @@ vntblinit(void *dummy __unused) uma_ctor ctor; uma_dtor dtor; int cpu, physvnodes, virtvnodes; - u_int i; /* * Desiredvnodes is a function of the physical memory size and the @@ -731,9 +734,6 @@ vntblinit(void *dummy __unused) syncer_maxdelay = syncer_mask + 1; mtx_init(&sync_mtx, "Syncer mtx", NULL, MTX_DEF); cv_init(&sync_wakeup, "syncer"); - for (i = 1; i <= sizeof(struct vnode); i <<= 1) - vnsz2log++; - vnsz2log--; CPU_FOREACH(cpu) { vd = DPCPU_ID_PTR((cpu), vd);