git: ff97bc034fcd - main - cache: simplify lockless dot lookups
Mateusz Guzik
mjg at FreeBSD.org
Mon Dec 28 02:03:18 UTC 2020
The branch main has been updated by mjg:
URL: https://cgit.FreeBSD.org/src/commit/?id=ff97bc034fcdf16207ed75e43622e9f0d91fa553
commit ff97bc034fcdf16207ed75e43622e9f0d91fa553
Author: Mateusz Guzik <mjg at FreeBSD.org>
AuthorDate: 2020-12-28 00:12:28 +0000
Commit: Mateusz Guzik <mjg at FreeBSD.org>
CommitDate: 2020-12-28 01:53:27 +0000
cache: simplify lockless dot lookups
---
sys/kern/vfs_cache.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 75c362534c91..22dfe01ac624 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -4317,19 +4317,18 @@ cache_fplookup_noentry(struct cache_fpl *fpl)
static int __noinline
cache_fplookup_dot(struct cache_fpl *fpl)
{
- struct vnode *dvp;
-
- dvp = fpl->dvp;
- fpl->tvp = dvp;
- fpl->tvp_seqc = vn_seqc_read_any(dvp);
- if (seqc_in_modify(fpl->tvp_seqc)) {
- return (cache_fpl_aborted(fpl));
- }
+ MPASS(!seqc_in_modify(fpl->dvp_seqc));
+ /*
+ * Just re-assign the value. seqc will be checked later for the first
+ * non-dot path component in line and/or before deciding to return the
+ * vnode.
+ */
+ fpl->tvp = fpl->dvp;
+ fpl->tvp_seqc = fpl->dvp_seqc;
counter_u64_add(dothits, 1);
- SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ".", dvp);
-
+ SDT_PROBE3(vfs, namecache, lookup, hit, fpl->dvp, ".", fpl->dvp);
return (0);
}
More information about the dev-commits-src-main
mailing list