diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2019-12-08 21:30:04 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2019-12-08 21:30:04 +0000 |
commit | abd80ddb9474948fb291becc395d72b40927a32b (patch) | |
tree | 5e32c99715a7ec2abcc89d4b8f76f07f0ad69bde /sys/kern/vfs_default.c | |
parent | 791a24c7ea7d3ad41c703327d40e64d3ef6d02e2 (diff) | |
download | src-abd80ddb9474948fb291becc395d72b40927a32b.tar.gz src-abd80ddb9474948fb291becc395d72b40927a32b.zip |
vfs: introduce v_irflag and make v_type smaller
The current vnode layout is not smp-friendly by having frequently read data
avoidably sharing cachelines with very frequently modified fields. In
particular v_iflag inspected for VI_DOOMED can be found in the same line with
v_usecount. Instead make it available in the same cacheline as the v_op, v_data
and v_type which all get read all the time.
v_type is avoidably 4 bytes while the necessary data will easily fit in 1.
Shrinking it frees up 3 bytes, 2 of which get used here to introduce a new
flag field with a new value: VIRF_DOOMED.
Reviewed by: kib, jeff
Differential Revision: https://reviews.freebsd.org/D22715
Notes
Notes:
svn path=/head/; revision=355537
Diffstat (limited to 'sys/kern/vfs_default.c')
-rw-r--r-- | sys/kern/vfs_default.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 8aee8abfbe7e..b12fe280bd09 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -594,7 +594,7 @@ vop_stdgetwritemount(ap) * Note that having a reference does not prevent forced unmount from * setting ->v_mount to NULL after the lock gets released. This is of * no consequence for typical consumers (most notably vn_start_write) - * since in this case the vnode is VI_DOOMED. Unmount might have + * since in this case the vnode is VIRF_DOOMED. Unmount might have * progressed far enough that its completion is only delayed by the * reference obtained here. The consumer only needs to concern itself * with releasing it. @@ -1019,7 +1019,7 @@ vop_stdadvise(struct vop_advise_args *ap) case POSIX_FADV_DONTNEED: error = 0; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - if (vp->v_iflag & VI_DOOMED) { + if (VN_IS_DOOMED(vp)) { VOP_UNLOCK(vp, 0); break; } |