summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Cantrill <bryan@joyent.com>2016-07-06 19:14:30 +0000
committerBryan Cantrill <bryan@joyent.com>2016-07-06 19:14:30 +0000
commit2e3725e9704127dc69c460e5308474f300885117 (patch)
tree57209bf26b0cb4d34d56d08c4c324a4386c84a61
parent5d8ee4be0214467fc42e9fd57125043790742b16 (diff)
downloadillumos-joyent-release-20160707.tar.gz
OS-5483 iostat -x shows around 100% utilization for idle zonerelease-20160707
Reviewed by: Joshua M. Clulow <jmc@joyent.com> Reviewed by: Patrick Mooney <patrick.mooney@joyent.com> Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Approved by: Robert Mustacchi <rm@joyent.com>
-rw-r--r--usr/src/uts/common/fs/vnode.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/usr/src/uts/common/fs/vnode.c b/usr/src/uts/common/fs/vnode.c
index a0aba42d83..5a54ef8eee 100644
--- a/usr/src/uts/common/fs/vnode.c
+++ b/usr/src/uts/common/fs/vnode.c
@@ -3409,11 +3409,12 @@ fop_read(
zone_t *zonep = curzone;
zone_vfs_kstat_t *zvp = zonep->zone_vfs_stats;
- hrtime_t start, lat;
+ hrtime_t start = 0, lat;
ssize_t len;
int err;
- if (vp->v_type == VREG || vp->v_type == VDIR || vp->v_type == VBLK) {
+ if ((vp->v_type == VREG || vp->v_type == VDIR || vp->v_type == VBLK) &&
+ vp->v_vfsp != NULL && (vp->v_vfsp->vfs_flag & VFS_STATS)) {
start = gethrtime();
mutex_enter(&zonep->zone_vfs_lock);
@@ -3428,7 +3429,7 @@ fop_read(
VOPSTATS_UPDATE_IO(vp, read, read_bytes, len);
- if (vp->v_type == VREG || vp->v_type == VDIR || vp->v_type == VBLK) {
+ if (start != 0) {
mutex_enter(&zonep->zone_vfs_lock);
zonep->zone_vfs_rwstats.reads++;
zonep->zone_vfs_rwstats.nread += len;
@@ -3471,7 +3472,7 @@ fop_write(
zone_t *zonep = curzone;
zone_vfs_kstat_t *zvp = zonep->zone_vfs_stats;
- hrtime_t start, lat;
+ hrtime_t start = 0, lat;
ssize_t len;
int err;
@@ -3480,7 +3481,8 @@ fop_write(
* repurposed as the active queue for VFS write operations. There's no
* actual wait queue for VFS operations.
*/
- if (vp->v_type == VREG || vp->v_type == VDIR || vp->v_type == VBLK) {
+ if ((vp->v_type == VREG || vp->v_type == VDIR || vp->v_type == VBLK) &&
+ vp->v_vfsp != NULL && (vp->v_vfsp->vfs_flag & VFS_STATS)) {
start = gethrtime();
mutex_enter(&zonep->zone_vfs_lock);
@@ -3495,7 +3497,7 @@ fop_write(
VOPSTATS_UPDATE_IO(vp, write, write_bytes, len);
- if (vp->v_type == VREG || vp->v_type == VDIR || vp->v_type == VBLK) {
+ if (start != 0) {
mutex_enter(&zonep->zone_vfs_lock);
zonep->zone_vfs_rwstats.writes++;
zonep->zone_vfs_rwstats.nwritten += len;