Print this page
Side-port of OS-2943 zone stuck 'down': references still extant (illumos-joyent 4cb09b44b4f851905a0e8cccbd9bfc834acc2041)

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/zfs_zone.c
          +++ new/usr/src/uts/common/fs/zfs/zfs_zone.c
↓ open down ↓ 2 lines elided ↑ open up ↑
   3    3   * Common Development and Distribution License ("CDDL"), version 1.0.
   4    4   * You may only use this file in accordance with the terms of version
   5    5   * 1.0 of the CDDL.
   6    6   *
   7    7   * A full copy of the text of the CDDL should have accompanied this
   8    8   * source.  A copy of the CDDL is also available via the Internet at
   9    9   * http://www.illumos.org/license/CDDL.
  10   10   */
  11   11  
  12   12  /*
  13      - * Copyright 2013, Joyent, Inc. All rights reserved.
       13 + * Copyright 2014, Joyent, Inc. All rights reserved.
  14   14   */
  15   15  
  16   16  /*
  17   17   * The ZFS/Zone I/O throttle and scheduler attempts to ensure fair access to
  18   18   * ZFS I/O resources for each zone.
  19   19   *
  20   20   * I/O contention can be major pain point on a multi-tenant system. A single
  21   21   * zone can issue a stream of I/O operations, usually synchronous writes, which
  22   22   * disrupt I/O performance for all other zones. This problem is further
  23   23   * exacerbated by ZFS, which buffers all asynchronous writes in a single TXG,
↓ open down ↓ 1110 lines elided ↑ open up ↑
1134 1134   */
1135 1135  void
1136 1136  zfs_zone_zio_done(zio_t *zp)
1137 1137  {
1138 1138          zone_t  *zonep;
1139 1139          hrtime_t now, unow, udelta;
1140 1140  
1141 1141          if (zp->io_type == ZIO_TYPE_IOCTL)
1142 1142                  return;
1143 1143  
1144      -        if ((zonep = zone_find_by_id(zp->io_zoneid)) == NULL)
     1144 +        if (zp->io_dispatched == 0)
1145 1145                  return;
1146 1146  
1147      -        if (zp->io_dispatched == 0)
     1147 +        if ((zonep = zone_find_by_id(zp->io_zoneid)) == NULL)
1148 1148                  return;
1149 1149  
1150 1150          now = gethrtime();
1151 1151          unow = NANO_TO_MICRO(now);
1152 1152          udelta = unow - NANO_TO_MICRO(zp->io_dispatched);
1153 1153  
1154 1154          mutex_enter(&zfs_disk_lock);
1155 1155          zfs_disk_rcnt--;
1156 1156          zfs_disk_rtime += (now - zfs_disk_rlastupdate);
1157 1157          zfs_disk_rlastupdate = now;
↓ open down ↓ 139 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX