Print this page
4334 Improve ZFS N-way mirror read performance

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/sys/vdev_impl.h
          +++ new/usr/src/uts/common/fs/zfs/sys/vdev_impl.h
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright (c) 2013 by Delphix. All rights reserved.
       24 + * Copyright (c) 2013 Steven Hartland. All rights reserved.
  24   25   */
  25   26  
  26   27  #ifndef _SYS_VDEV_IMPL_H
  27   28  #define _SYS_VDEV_IMPL_H
  28   29  
  29   30  #include <sys/avl.h>
  30   31  #include <sys/dmu.h>
  31   32  #include <sys/metaslab.h>
  32   33  #include <sys/nvpair.h>
  33   34  #include <sys/space_map.h>
↓ open down ↓ 75 lines elided ↑ open up ↑
 109  110          avl_tree_t      vqc_queued_tree;
 110  111  } vdev_queue_class_t;
 111  112  
 112  113  struct vdev_queue {
 113  114          vdev_t          *vq_vdev;
 114  115          vdev_queue_class_t vq_class[ZIO_PRIORITY_NUM_QUEUEABLE];
 115  116          avl_tree_t      vq_active_tree;
 116  117          uint64_t        vq_last_offset;
 117  118          hrtime_t        vq_io_complete_ts; /* time last i/o completed */
 118  119          kmutex_t        vq_lock;
      120 +        uint64_t        vq_lastoffset;
 119  121  };
 120  122  
 121  123  /*
 122  124   * Virtual device descriptor
 123  125   */
 124  126  struct vdev {
 125  127          /*
 126  128           * Common to all vdev types.
 127  129           */
 128  130          uint64_t        vdev_id;        /* child number in vdev parent  */
↓ open down ↓ 72 lines elided ↑ open up ↑
 201  203          boolean_t       vdev_detached;  /* device detached?             */
 202  204          boolean_t       vdev_cant_read; /* vdev is failing all reads    */
 203  205          boolean_t       vdev_cant_write; /* vdev is failing all writes  */
 204  206          boolean_t       vdev_isspare;   /* was a hot spare              */
 205  207          boolean_t       vdev_isl2cache; /* was a l2cache device         */
 206  208          vdev_queue_t    vdev_queue;     /* I/O deadline schedule queue  */
 207  209          vdev_cache_t    vdev_cache;     /* physical block cache         */
 208  210          spa_aux_vdev_t  *vdev_aux;      /* for l2cache vdevs            */
 209  211          zio_t           *vdev_probe_zio; /* root of current probe       */
 210  212          vdev_aux_t      vdev_label_aux; /* on-disk aux state            */
      213 +        uint16_t        vdev_rotation_rate; /* rotational rate of the media */
      214 +#define VDEV_RATE_UNKNOWN       0
      215 +#define VDEV_RATE_NON_ROTATING  1
 211  216  
 212  217          /*
 213  218           * For DTrace to work in userland (libzpool) context, these fields must
 214  219           * remain at the end of the structure.  DTrace will use the kernel's
 215  220           * CTF definition for 'struct vdev', and since the size of a kmutex_t is
 216  221           * larger in userland, the offsets for the rest of the fields would be
 217  222           * incorrect.
 218  223           */
 219  224          kmutex_t        vdev_dtl_lock;  /* vdev_dtl_{map,resilver}      */
 220  225          kmutex_t        vdev_stat_lock; /* vdev_stat                    */
↓ open down ↓ 130 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX