From nobody Mon Oct 11 09:15:45 2021 X-Original-To: dev-commits-src-branches@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 36DFA17F9058; Mon, 11 Oct 2021 09:15:46 +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 4HSY754vQmz3Mv3; Mon, 11 Oct 2021 09:15:45 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 7E1361E4C1; Mon, 11 Oct 2021 09:15:45 +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 19B9Fjd1009404; Mon, 11 Oct 2021 09:15:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19B9Fj3B009403; Mon, 11 Oct 2021 09:15:45 GMT (envelope-from git) Date: Mon, 11 Oct 2021 09:15:45 GMT Message-Id: <202110110915.19B9Fj3B009403@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 93b14ce63d0a - stable/13 - cache: count vnodes in cache_purgevfs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 93b14ce63d0a6dc926e8e5fe9394df23e490c3e0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=93b14ce63d0a6dc926e8e5fe9394df23e490c3e0 commit 93b14ce63d0a6dc926e8e5fe9394df23e490c3e0 Author: Mateusz Guzik AuthorDate: 2021-09-18 08:30:15 +0000 Commit: Mateusz Guzik CommitDate: 2021-10-11 09:09:47 +0000 cache: count vnodes in cache_purgevfs (cherry picked from commit a2cb65b8fe975a8f228258e3057b62e068dbf8e2) --- sys/kern/vfs_cache.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 09f926d0cd31..54a87ced2218 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -237,7 +237,7 @@ SDT_PROBE_DEFINE2(vfs, namecache, removecnp, hit, "struct vnode *", "struct componentname *"); SDT_PROBE_DEFINE2(vfs, namecache, removecnp, miss, "struct vnode *", "struct componentname *"); -SDT_PROBE_DEFINE1(vfs, namecache, purge, done, "struct vnode *"); +SDT_PROBE_DEFINE3(vfs, namecache, purge, done, "struct vnode *", "size_t", "size_t"); SDT_PROBE_DEFINE1(vfs, namecache, purge, batch, "int"); SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done, "struct vnode *"); SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, "struct mount *"); @@ -3014,13 +3014,15 @@ void cache_purgevfs(struct mount *mp) { struct vnode *vp, *mvp; + size_t visited, purged; - SDT_PROBE1(vfs, namecache, purgevfs, done, mp); + visited = purged = 0; /* * Somewhat wasteful iteration over all vnodes. Would be better to * support filtering and avoid the interlock to begin with. */ MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { + visited++; if (!cache_has_entries(vp)) { VI_UNLOCK(vp); continue; @@ -3028,8 +3030,11 @@ cache_purgevfs(struct mount *mp) vholdl(vp); VI_UNLOCK(vp); cache_purge(vp); + purged++; vdrop(vp); } + + SDT_PROBE3(vfs, namecache, purgevfs, done, mp, visited, purged); } /*