bb2eed3aa5
When devices are formatted as btrfs, btrfs_prepare_device is called sequentially for each device, which takes too much time. Put each btrfs_prepare_device into a thread, wait for the first thread to complete to mkfs.btrfs, and wait for other threads to complete before adding other devices to the file system. During the preparation it's either trim/discard or zone reset. This was tested with TCMU emulation with two zoned devices. Each device is 2000G (about 19.53 TiB), the region size is 4MB, Use the following parameters for targetcli: create name=zbc0 size=20000G cfgstring=model-HM/zsize-4/conv-100@~/zbc0.raw Call difftime to calculate the running time of the function btrfs_prepare_device. Calculate the time from thread creation to completion of all threads after patching: $ lsscsi -p [10:0:1:0] (0x14) LIO-ORG TCMU ZBC device 0002 /dev/sdb - none [11:0:1:0] (0x14) LIO-ORG TCMU ZBC device 0002 /dev/sdc - none $ sudo mkfs.btrfs -d single -m single -O zoned /dev/sdc /dev/sdb -f .... time for prepare devices:4.000000. .... $ sudo mkfs.btrfs -d single -m single -O zoned /dev/sdc /dev/sdb -f ... time for prepare devices:2.000000. ... Issue: #496 Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Li Zhang <zhanglikernel@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com> |
||
---|---|---|
.. | ||
Makefile | ||
common.c | ||
common.h | ||
main.c | ||
rootdir.c | ||
rootdir.h |