aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/ctl
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/cam/ctl
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/cam/ctl')
-rw-r--r--sys/cam/ctl/ctl_backend_block.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c
index cbe25c07f14c..eeddf1735bce 100644
--- a/sys/cam/ctl/ctl_backend_block.c
+++ b/sys/cam/ctl/ctl_backend_block.c
@@ -843,7 +843,7 @@ ctl_be_block_getattr_file(struct ctl_be_block_lun *be_lun, const char *attrname)
val = vattr.va_bytes / be_lun->cbe_lun.blocksize;
}
if (strcmp(attrname, "blocksavail") == 0 &&
- (be_lun->vn->v_iflag & VI_DOOMED) == 0) {
+ !VN_IS_DOOMED(be_lun->vn)) {
error = VFS_STATFS(be_lun->vn->v_mount, &statfs);
if (error == 0)
val = statfs.f_bavail * statfs.f_bsize /