Print this page
7938 Port ZOL #3712 disable LBA weighting on files and SSDs

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/metaslab.c
          +++ new/usr/src/uts/common/fs/zfs/metaslab.c
↓ open down ↓ 1641 lines elided ↑ open up ↑
1642 1642  
1643 1643          /*
1644 1644           * Modern disks have uniform bit density and constant angular velocity.
1645 1645           * Therefore, the outer recording zones are faster (higher bandwidth)
1646 1646           * than the inner zones by the ratio of outer to inner track diameter,
1647 1647           * which is typically around 2:1.  We account for this by assigning
1648 1648           * higher weight to lower metaslabs (multiplier ranging from 2x to 1x).
1649 1649           * In effect, this means that we'll select the metaslab with the most
1650 1650           * free bandwidth rather than simply the one with the most free space.
1651 1651           */
1652      -        if (metaslab_lba_weighting_enabled) {
     1652 +        if (!vd->vdev_nonrot && metaslab_lba_weighting_enabled) {
1653 1653                  weight = 2 * weight - (msp->ms_id * weight) / vd->vdev_ms_count;
1654 1654                  ASSERT(weight >= space && weight <= 2 * space);
1655 1655          }
1656 1656  
1657 1657          /*
1658 1658           * If this metaslab is one we're actively using, adjust its
1659 1659           * weight to make it preferable to any inactive metaslab so
1660 1660           * we'll polish it off. If the fragmentation on this metaslab
1661 1661           * has exceed our threshold, then don't mark it active.
1662 1662           */
↓ open down ↓ 1738 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX