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/vm/vnode_pager.c | |
parent | 791a24c7ea7d3ad41c703327d40e64d3ef6d02e2 (diff) |
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/vm/vnode_pager.c')
-rw-r--r-- | sys/vm/vnode_pager.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index d8c7e2f5eea8..c57aa8d72e09 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -374,7 +374,7 @@ vnode_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, * If no vp or vp is doomed or marked transparent to VM, we do not * have the page. */ - if (vp == NULL || vp->v_iflag & VI_DOOMED) + if (vp == NULL || VN_IS_DOOMED(vp)) return FALSE; /* * If the offset is beyond end of file we do @@ -553,7 +553,7 @@ vnode_pager_addr(struct vnode *vp, vm_ooffset_t address, daddr_t *rtaddress, if (address < 0) return -1; - if (vp->v_iflag & VI_DOOMED) + if (VN_IS_DOOMED(vp)) return -1; bsize = vp->v_mount->mnt_stat.f_iosize; @@ -591,7 +591,7 @@ vnode_pager_input_smlfs(vm_object_t object, vm_page_t m) error = 0; vp = object->handle; - if (vp->v_iflag & VI_DOOMED) + if (VN_IS_DOOMED(vp)) return VM_PAGER_BAD; bsize = vp->v_mount->mnt_stat.f_iosize; @@ -815,7 +815,7 @@ vnode_pager_generic_getpages(struct vnode *vp, vm_page_t *m, int count, KASSERT(vp->v_type != VCHR && vp->v_type != VBLK, ("%s does not support devices", __func__)); - if (vp->v_iflag & VI_DOOMED) + if (VN_IS_DOOMED(vp)) return (VM_PAGER_BAD); object = vp->v_object; |