summaryrefslogtreecommitdiffstats
path: root/module/zfs/metaslab.c
diff options
context:
space:
mode:
authorRichard Yao <[email protected]>2015-08-29 12:01:07 -0400
committerBrian Behlendorf <[email protected]>2015-09-01 15:22:07 -0700
commitfb40095f5f0853946f8150481ca22602d1334dfe (patch)
treed0c1617c305088d01b7c3db29c46824c610c0f5f /module/zfs/metaslab.c
parentcafbd2aca3fd17be78577348d9661f4142d1eb70 (diff)
Disable LBA weighting on files and SSDs
The LBA weighting makes sense on rotational media where the outer tracks have twice the bandwidth of the inner tracks. However, it is detrimental on nonrotational media such as solid state disks, where the only effect is to ensure that metaslabs enter the best-fit allocation behavior sooner, which is detrimental to performance. It also makes no sense on files where the underlying filesystem can arrange things however it wants. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #3712
Diffstat (limited to 'module/zfs/metaslab.c')
-rw-r--r--module/zfs/metaslab.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/metaslab.c b/module/zfs/metaslab.c
index b328cbb0a..59bcefd34 100644
--- a/module/zfs/metaslab.c
+++ b/module/zfs/metaslab.c
@@ -1518,7 +1518,7 @@ metaslab_weight(metaslab_t *msp)
* In effect, this means that we'll select the metaslab with the most
* free bandwidth rather than simply the one with the most free space.
*/
- if (metaslab_lba_weighting_enabled) {
+ if (!vd->vdev_nonrot && metaslab_lba_weighting_enabled) {
weight = 2 * weight - (msp->ms_id * weight) / vd->vdev_ms_count;
ASSERT(weight >= space && weight <= 2 * space);
}