On 2018/8/21 下午10:24, David Sterba wrote: > On Tue, Aug 21, 2018 at 02:43:35PM +0100, David Howells wrote: >> Qu Wenruo <quwenruo.bt...@gmx.com> wrote: >> >>> But to be more clear, NOSSD shouldn't be a special case. >>> In fact currently NOSSD only affects whether we will output the message >>> "enabling ssd optimization", no real effect if I didn't miss anything. > > There is a real effect. > >> That's not quite true. In: >> >> if (!btrfs_test_opt(fs_info, NOSSD) && >> !fs_info->fs_devices->rotating) { >> btrfs_set_and_info(fs_info, SSD, "enabling ssd optimizations"); >> } >> >> the call to btrfs_set_and_info() will turn on SSD.
Oh, I just missed the btrfs_set part. (even it's myself introduced that function). What a shame... Thanks, Qu >> >> What this seems to me is that, normally, SSD will be turned on automatically >> unless at least one of the devices is a rotating medium - but this appears to >> be explicitly suppressed by the NOSSD option. > > Right. So expected behaviour: > > - nothing: auto-detect non-rotating devices, enable SSD mount option in turn > - nossd: disable auto-detection of non-rotating devices > - ssd: enable SSD optimizations uconditionally > - ssd_spread: implies SSD and affects some allocator decisions regarding > new extent alignments >
signature.asc
Description: OpenPGP digital signature