btrfs-progs/common
Sheng Mao 9870d504d8 btrfs-progs: align receive buffer to enable fast CRC
To use optimized CRC implementation, the input buffer must be
unsigned long aligned. btrfs receive calculates checksum based on
read_buf, including btrfs_cmd_header (with zeroed CRC field)
and command content.

Reorder the buffer to the beginning of the structure and force the
alignment to 64, this should be cacheline friendly and could speed up
the data transfers.

Interesting parts from the report:

Sending host:
Fedora 33
AMD ThreadRipper 1920X - 128GB RAM
2x10GBit Ethernet, bonded
MegaRaid 9270
6x16TB Seagate Exos in RAID5

Receiving host:
Fedora 33
Intel i3-7300 - HT enabled - 32GB RAM
10GBit Ethernet, single connection
MegaRaid 9260
12x8TB WD NAS drives in RAID5

The 2 hosts are connected to the same 10G switch. The sender could definitely
saturate a 10GBit link. The practically achievable writes on the backup host
would be lower, but still at least 400MB/s. The file system contains mostly
large files of 1GB+, so there is little meta-data.

With btrfs send/receive I'm getting a steady transfer rate of 60MB/s. The copy
has been running for a little over 5 days now, having only transferred some
25TB. This is way too slow for this setup.

Analyzing resource usage, the sender side is fine, both the btrfs send and the
corresponding ssh process only use about 10-10% CPU, which on a 24 threaded
machine is virtually nothing. However, the receiver is running with a load of
~2.6, with the sshd using 30-50% CPU and the btrfs receive a further 60-70%.
The rest of the load comes from IO wait. So the bottleneck is the btrfs receive
clearly.

Issue: #324
Signed-off-by: Sheng Mao <shngmao@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2021-01-18 17:49:22 +01:00
..
box.h
defs.h
device-scan.c btrfs-progs: move volumes.c to kernel-shared/ 2020-08-31 17:01:06 +02:00
device-scan.h btrfs-progs: refactor btrfs_scan_devices() to accept verbose argument 2020-06-12 19:31:58 +02:00
device-utils.c btrfs-progs: move disk-io.c to kernel-shared/ 2020-08-31 17:01:05 +02:00
device-utils.h
extent-cache.c btrfs-progs: move extent-cache.c to common/ 2020-08-31 17:01:04 +02:00
extent-cache.h btrfs-progs: move extent-cache.c to common/ 2020-08-31 17:01:04 +02:00
format-output.c btrfs-progs: initialize formatter context properly 2021-01-13 22:33:09 +01:00
format-output.h
fsfeatures.c btrfs-progs: mkfs: refactor how we handle sectorsize override 2020-12-10 17:10:30 +01:00
fsfeatures.h btrfs-progs: mkfs: refactor how we handle sectorsize override 2020-12-10 17:10:30 +01:00
help.c
help.h btrfs-progs: add global verbose and quiet options and helper functions 2020-06-12 19:30:43 +02:00
internal.h
messages.c btrfs-progs: add global verbose and quiet options and helper functions 2020-06-12 19:30:43 +02:00
messages.h btrfs-progs: add separate verbosity level for on-by-default messages 2020-06-12 19:32:29 +02:00
path-utils.c btrfs-progs: move path_cat_out helpers to path-utils 2020-11-04 23:26:43 +01:00
path-utils.h btrfs-progs: move path_cat_out helpers to path-utils 2020-11-04 23:26:43 +01:00
rbtree-utils.c
rbtree-utils.h
send-stream.c btrfs-progs: align receive buffer to enable fast CRC 2021-01-18 17:49:22 +01:00
send-stream.h btrfs-progs: move send-stream.c to common/ 2020-08-31 17:01:04 +02:00
send-utils.c btrfs-progs: move path_cat_out helpers to path-utils 2020-11-04 23:26:43 +01:00
send-utils.h btrfs-progs: move ctree.c to kernel-shared/ 2020-08-31 17:01:05 +02:00
string-table.c
string-table.h
task-utils.c
task-utils.h
utils-lib.c btrfs-progs: move ctree.c to kernel-shared/ 2020-08-31 17:01:05 +02:00
utils.c btrfs-progs: utils: introduce find_mount_fsroot 2021-01-18 17:49:22 +01:00
utils.h btrfs-progs: utils: introduce find_mount_fsroot 2021-01-18 17:49:22 +01:00