git: 8b622172ba44 - main - vfs cache: add 2 more optimizaiton ideas

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Thu, 05 Oct 2023 12:44:51 UTC
The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=8b622172ba44f914092c1d44cecb2b101eb8e17b

commit 8b622172ba44f914092c1d44cecb2b101eb8e17b
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2023-10-05 12:38:32 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2023-10-05 12:44:43 +0000

    vfs cache: add 2 more optimizaiton ideas
---
 sys/kern/vfs_cache.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index cc2f405d5281..99e293d5a873 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -276,6 +276,20 @@
  * It could become part of the API contract to *always* have a rootvnode set in
  * mnt_rootvnode. Such vnodes are annotated with VV_ROOT and vnlru would have
  * to be modified to always skip them.
+ *
+ * === inactive on v_usecount reaching 0
+ *
+ * VOP_NEED_INACTIVE should not exist. Filesystems would indicate need for such
+ * processing with a bit in usecount.
+ *
+ * === v_holdcnt
+ *
+ * Hold count should probably get eliminated, but one can argue it is a useful
+ * feature. Even if so, handling of v_usecount could be decoupled from it --
+ * vnlru et al would consider the vnode not-freeable if has either hold or
+ * usecount on it.
+ *
+ * This would eliminate 2 atomics.
  */
 
 static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,