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


1645                  * If space < SPA_MINBLOCKSIZE, then we will not allocate from
1646                  * this metaslab again. The fragmentation metric may have
1647                  * decreased the space to something smaller than
1648                  * SPA_MINBLOCKSIZE, so reset the space to SPA_MINBLOCKSIZE
1649                  * so that we can consume any remaining space.
1650                  */
1651                 if (space > 0 && space < SPA_MINBLOCKSIZE)
1652                         space = SPA_MINBLOCKSIZE;
1653         }
1654         weight = space;
1655 
1656         /*
1657          * Modern disks have uniform bit density and constant angular velocity.
1658          * Therefore, the outer recording zones are faster (higher bandwidth)
1659          * than the inner zones by the ratio of outer to inner track diameter,
1660          * which is typically around 2:1.  We account for this by assigning
1661          * higher weight to lower metaslabs (multiplier ranging from 2x to 1x).
1662          * In effect, this means that we'll select the metaslab with the most
1663          * free bandwidth rather than simply the one with the most free space.
1664          */
1665         if (metaslab_lba_weighting_enabled) {
1666                 weight = 2 * weight - (msp->ms_id * weight) / vd->vdev_ms_count;
1667                 ASSERT(weight >= space && weight <= 2 * space);
1668         }
1669 
1670         /*
1671          * If this metaslab is one we're actively using, adjust its
1672          * weight to make it preferable to any inactive metaslab so
1673          * we'll polish it off. If the fragmentation on this metaslab
1674          * has exceed our threshold, then don't mark it active.
1675          */
1676         if (msp->ms_loaded && msp->ms_fragmentation != ZFS_FRAG_INVALID &&
1677             msp->ms_fragmentation <= zfs_metaslab_fragmentation_threshold) {
1678                 weight |= (msp->ms_weight & METASLAB_ACTIVE_MASK);
1679         }
1680 
1681         WEIGHT_SET_SPACEBASED(weight);
1682         return (weight);
1683 }
1684 
1685 /*




1645                  * If space < SPA_MINBLOCKSIZE, then we will not allocate from
1646                  * this metaslab again. The fragmentation metric may have
1647                  * decreased the space to something smaller than
1648                  * SPA_MINBLOCKSIZE, so reset the space to SPA_MINBLOCKSIZE
1649                  * so that we can consume any remaining space.
1650                  */
1651                 if (space > 0 && space < SPA_MINBLOCKSIZE)
1652                         space = SPA_MINBLOCKSIZE;
1653         }
1654         weight = space;
1655 
1656         /*
1657          * Modern disks have uniform bit density and constant angular velocity.
1658          * Therefore, the outer recording zones are faster (higher bandwidth)
1659          * than the inner zones by the ratio of outer to inner track diameter,
1660          * which is typically around 2:1.  We account for this by assigning
1661          * higher weight to lower metaslabs (multiplier ranging from 2x to 1x).
1662          * In effect, this means that we'll select the metaslab with the most
1663          * free bandwidth rather than simply the one with the most free space.
1664          */
1665         if (!vd->vdev_nonrot && metaslab_lba_weighting_enabled) {
1666                 weight = 2 * weight - (msp->ms_id * weight) / vd->vdev_ms_count;
1667                 ASSERT(weight >= space && weight <= 2 * space);
1668         }
1669 
1670         /*
1671          * If this metaslab is one we're actively using, adjust its
1672          * weight to make it preferable to any inactive metaslab so
1673          * we'll polish it off. If the fragmentation on this metaslab
1674          * has exceed our threshold, then don't mark it active.
1675          */
1676         if (msp->ms_loaded && msp->ms_fragmentation != ZFS_FRAG_INVALID &&
1677             msp->ms_fragmentation <= zfs_metaslab_fragmentation_threshold) {
1678                 weight |= (msp->ms_weight & METASLAB_ACTIVE_MASK);
1679         }
1680 
1681         WEIGHT_SET_SPACEBASED(weight);
1682         return (weight);
1683 }
1684 
1685 /*