Thread (4 messages) 4 messages, 3 authors, 2024-02-20

Re: [PATCH v3] btrfs: introduce offload_csum_mode to tweak checksum offloading behavior

From: David Sterba <hidden>
Date: 2024-02-20 12:22:49

On Mon, Feb 05, 2024 at 10:01:16PM +0900, Naohiro Aota wrote:
We disable offloading checksum to workqueues and do it synchronously when
the checksum algorithm is fast. However, as reported in the link below,
RAID0 with multiple devices may suffer from the sync checksum, because
"fast checksum" is still not fast enough to catch up RAID0 writing.

To measure the effectiveness of sync checksum and checksum offloading for
developers, it would be better to have a switch for the checksum offloading
under CONFIG_BTRFS_DEBUG hood.

This commit introduces fs_devices->offload_csum_mode for
CONFIG_BTRFS_DEBUG, so that a btrfs developer can change the behavior by
writing to /sys/fs/btrfs/<uuid>/offload_csum. The default is "auto" which
is the same as the previous behavior. Or, you can set "on" or "off" (or "y"
or "n" whatever kstrtobool() accepts) to always/never offload checksum.

More benchmark should be collected with this knob to implement a proper
criteria to enable/disable checksum offloading.

Link: https://lore.kernel.org/linux-btrfs/20230731152223.4EFB.409509F4@e16-tech.com/ (local)
Link: https://lore.kernel.org/linux-btrfs/p3vo3g7pqn664mhmdhlotu5dzcna6vjtcoc2hb2lsgo2fwct7k@xzaxclba5tae/ (local)
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
I'm adding this to for-next.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help