aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/pseudofs
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2019-12-08 21:30:04 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2019-12-08 21:30:04 +0000
commitabd80ddb9474948fb291becc395d72b40927a32b (patch)
tree5e32c99715a7ec2abcc89d4b8f76f07f0ad69bde /sys/fs/pseudofs
parent791a24c7ea7d3ad41c703327d40e64d3ef6d02e2 (diff)
downloadsrc-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/fs/pseudofs')
-rw-r--r--sys/fs/pseudofs/pseudofs_vnops.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/fs/pseudofs/pseudofs_vnops.c b/sys/fs/pseudofs/pseudofs_vnops.c
index ce15547e44f5..0a3c9e967706 100644
--- a/sys/fs/pseudofs/pseudofs_vnops.c
+++ b/sys/fs/pseudofs/pseudofs_vnops.c
@@ -290,7 +290,7 @@ pfs_ioctl(struct vop_ioctl_args *va)
vn = va->a_vp;
vn_lock(vn, LK_SHARED | LK_RETRY);
- if (vn->v_iflag & VI_DOOMED) {
+ if (VN_IS_DOOMED(vn)) {
VOP_UNLOCK(vn, 0);
return (EBADF);
}
@@ -512,7 +512,7 @@ pfs_lookup(struct vop_cachedlookup_args *va)
vfs_rel(mp);
if (error != 0)
PFS_RETURN(ENOENT);
- if (vn->v_iflag & VI_DOOMED) {
+ if (VN_IS_DOOMED(vn)) {
vfs_unbusy(mp);
PFS_RETURN(ENOENT);
}
@@ -581,13 +581,13 @@ pfs_lookup(struct vop_cachedlookup_args *va)
if (cnp->cn_flags & ISDOTDOT) {
vfs_unbusy(mp);
vn_lock(vn, LK_EXCLUSIVE | LK_RETRY);
- if (vn->v_iflag & VI_DOOMED) {
+ if (VN_IS_DOOMED(vn)) {
vput(*vpp);
*vpp = NULL;
PFS_RETURN(ENOENT);
}
}
- if (cnp->cn_flags & MAKEENTRY && !(vn->v_iflag & VI_DOOMED))
+ if (cnp->cn_flags & MAKEENTRY && !VN_IS_DOOMED(vn))
cache_enter(vn, *vpp, cnp);
PFS_RETURN (0);
failed: