Zfs: autodetect ashift better

Created on 6 Nov 2020  路  4Comments  路  Source: openzfs/zfs

Autodetect on SSD results in ashift=9 but this is obviously nonsense. Please check whether the drive is rotational or not before propagating this brokenness onto my pool.

Question

Most helpful comment

Do you propose to enforce some ashift for all non-rotatinf devices? I think it is very wrong assumption. If flash block us 32KB, it may have no big difference whether ashift is 9 or 12, both are equally bad, while bumping ashift to 12 may reduce space ZFS efficiency and increase disk and flash traffic without need.

This is not totally correct: while ashift=12 does not means aligning to flash page nowadays, SSD's controllers (and FTLs) are way more optimized to manage 4K writes rather than 512B ones.

I would propose a much simpler approach: simply let zfs create ashift=12 pools by default, leaving the choice of 512B (or other values) at user requests. This will solve 99% of user issues, leaving other users/sysadmins the power to specify different ashift when it make sense.

Note: I propose the above for both rotational (ie: HDD) and non-rotational (SSD, Optane, etc) storage devices. This will even have the good side effect of removing the device blacklist once included (still present?) in zfs.

All 4 comments

Do you propose to enforce some ashift for all non-rotatinf devices? I think it is very wrong assumption. If flash block us 32KB, it may have no big difference whether ashift is 9 or 12, both are equally bad, while bumping ashift to 12 may reduce space ZFS efficiency and increase disk and flash traffic without need.

If there is more than one way to detect the underlying device sector geometries, perhaps ZFS should use all of the along with rotational vs ssd, and provide a warning/error if there are discrepancies, forcing the user to explicitly set a value based on research of the device?

Do you propose to enforce some ashift for all non-rotatinf devices? I think it is very wrong assumption. If flash block us 32KB, it may have no big difference whether ashift is 9 or 12, both are equally bad, while bumping ashift to 12 may reduce space ZFS efficiency and increase disk and flash traffic without need.

This is not totally correct: while ashift=12 does not means aligning to flash page nowadays, SSD's controllers (and FTLs) are way more optimized to manage 4K writes rather than 512B ones.

I would propose a much simpler approach: simply let zfs create ashift=12 pools by default, leaving the choice of 512B (or other values) at user requests. This will solve 99% of user issues, leaving other users/sysadmins the power to specify different ashift when it make sense.

Note: I propose the above for both rotational (ie: HDD) and non-rotational (SSD, Optane, etc) storage devices. This will even have the good side effect of removing the device blacklist once included (still present?) in zfs.

As of 2017, NAND-flash SSDs are tuned for 4096-byte IOs. Matching the flash page size is unnecessary and ashift=12 is usually the correct choice.

Even if the code is still setting ashift based on legacy nonsense the docs have it straight.

Was this page helpful?
0 / 5 - 0 ratings