From nobody Thu Sep 14 16:40:19 2023 X-Original-To: dev-commits-src-main@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 4Rmjjb71QVz4t20R; Thu, 14 Sep 2023 16:40:19 +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 4Rmjjb6W2Kz3P3k; Thu, 14 Sep 2023 16:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694709619; 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=eZU6vMGX5b0VoYPv5Z3D8L5mCUGE4cudm1+U4qqjsZs=; b=PP0cYX2nJTjnBtcbYsRtwGR60An8ZNurPx2KX+VhHZtX3HCyZaIdY21zln7w2CRS2SjKgz xsBCUgi74LUhwRUvZVnFZkLAHdCrc5pmOhY8w57OG7TqDcH7o5DAuYxtEZ6Qu4Swdfwkal RJGtpckoyWGAHaOrxiEaXnBK7JzDhbw0sBvCo/f07bFv165A3rr06KplcAKpnhBZ/N3BNR 5Sms5dCBQLH2d4yp0ErqZ5thr8jFzv2+LOmlsF+lGXqVXjzoctHJOVSI5wpYommJQNdorj +cpfPh60JzbIxMHFuEK4611QY+XUGpgFPqJ7cOGOGDgIPB4zP4ORHWNAu9aL/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694709619; a=rsa-sha256; cv=none; b=mglgorYdlLZ165NxVn0OWQq0xzmJiBI+xmbJqc/vUBJK7Bq8VaWd2fAl4/rob4hh2+/DiP +msfaW1FjjRqkOlEELaxRC9UmSSiHca7hbLI2GTy99j/Wm0klEO7KYG1TRkRAhRg/xQUyh DRMBdw5jeV7YTT7Fh2sKAt18Rr62231n9MN9eRdJAINeN20TPQ/5/+5I1aYLMxobi5wO9L B0XCegEL1guexZxn2YB3P0is6ZTQUfjcHIUXR2onnOE5WtFCYE0aNh7QwIyGbIcPFZSRZ6 rRW5plpcmHHwYXYPDvLgi4x9+Vkuk1LH1Xtnivc5zx432IHI9FXDoLm6yWjMEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694709619; 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=eZU6vMGX5b0VoYPv5Z3D8L5mCUGE4cudm1+U4qqjsZs=; b=T73W7gGp51odzx8Zgb0DVQHVcoKXpkStlExyC/pkLrRUS9ZnRPEtbOfmijLArmVpgTBLQr Adt6ECauvH4sPukUcZiPpBuV+fs9wL9R0gIvoqpL477wLID/Y7AweulcV+UGRWsIYvvKQ6 wUn+HVKSQ3Psp+vKwihc0Bhu6GfxwL9zMn+6qeqaQzyBtMfB5I8S8mP61rcJO/PVgclHZN au+ovNsIKUjJDzRBbYlrL2ukxDmy5dT/NVAAyRYdpMMzLuHDA+bOzV0/+XFA0hx1jd9QYf sVVgXmC26JxbPojQVguyyDWrl1WUvPvUFW8iI/NLCqhKAEU3m5pY+BzN9bz2iA== 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 4Rmjjb5c8sz146k; Thu, 14 Sep 2023 16:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38EGeJV9055502; Thu, 14 Sep 2023 16:40:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38EGeJQn055499; Thu, 14 Sep 2023 16:40:19 GMT (envelope-from git) Date: Thu, 14 Sep 2023 16:40:19 GMT Message-Id: <202309141640.38EGeJQn055499@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: 76f1153790b6 - main - vfs: don't kick vnlru if it is already running List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 76f1153790b6d2e1a4f0389c3ac24e41d08f9ba6 Auto-Submitted: auto-generated The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=76f1153790b6d2e1a4f0389c3ac24e41d08f9ba6 commit 76f1153790b6d2e1a4f0389c3ac24e41d08f9ba6 Author: Mateusz Guzik AuthorDate: 2023-09-14 16:27:47 +0000 Commit: Mateusz Guzik CommitDate: 2023-09-14 16:40:14 +0000 vfs: don't kick vnlru if it is already running Further shaves some lock trips. --- sys/kern/vfs_subr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 80ec15f78028..4c9cb6200f10 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1557,9 +1557,11 @@ vnlru_kick_locked(void) } static void -vnlru_kick(void) +vnlru_kick_cond(void) { + if (vnlruproc_sig) + return; mtx_lock(&vnode_list_mtx); vnlru_kick_locked(); mtx_unlock(&vnode_list_mtx); @@ -1812,7 +1814,7 @@ alloc: mtx_assert(&vnode_list_mtx, MA_NOTOWNED); rnumvnodes = atomic_fetchadd_long(&numvnodes, 1) + 1; if (vnlru_under(rnumvnodes, vlowat)) - vnlru_kick(); + vnlru_kick_cond(); return (uma_zalloc_smr(vnode_zone, M_WAITOK)); }