What I am wondering is if any mount options (e.g. discard (TRIM), noatime, etc) are useful when mounting bcache, or if bcache its self takes care of optimising the filesystem for the SSD and HDD partitions.

1 Answer
1

discard is a special case: bcache will (I think) make use of it to discard sectors, but won't pass it down the stack unless you have explicitly asked it to (echo 1 |sudo tee -a /sys/block/*/bcache/discard, which will be remembered across reboots). The best case for performance is that your filesystem sends discards (which means you need to put the flag in /etc/fstab) and bcache passes them down if and only if your SSD is SATA 3.1 (queued TRIM support).

Your filesystem is able to detect bcache as something like an SSD (rotational=0 in sysfs), which it may use to tune itself a bit differently. Aside from discard and noatime, I don't think there's a real need to stray from ext4 defaults.

I think what I want is for bcache to use discard and noatime on the SSD cache, but not on the HDD storage partition. Are you saying that by mounting the ext4 filesystem with those options and telling bcache to pass them down to each device, they will only be applied to applicable devices? Or will bcache try to use discard on my HDD as well? Or do I not need bcache to pass them down at all to get the benefits on the SSD cache? Apologies for my confusion.
–
MattSturgeonJan 12 '14 at 14:12

If you want bcache to discard buckets on the SSD, you must use bcache's sysfs flag. I'm not sure about the rest; it would take more familiarity with the code.
–
GabrielJan 12 '14 at 23:42