lfs migrate is slow because it mostly uses a small 1MB buffer. Bigify.
[root@kjlmo4n00 16G]# time lfs migrate -S 1M -p flash 16G.1
real 0m25.341s
[root@kjlmo4n00 16G]# time /root/tools/lfs_nzr migrate -S 1M -p flash 16G.1
real 0m6.526s
Signed-off-by: Nathan Rutman <nathan.rutman@hpe.com>
Change-Id: I850ca475fcd0efe2d71d26e4d1544f462c60252a
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50118
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
long stats_interval_sec, off_t file_size_bytes)
{
struct llapi_layout *layout;
- size_t buf_size = 4 * 1024 * 1024;
+ size_t buf_size = 64 * 1024 * 1024;
void *buf = NULL;
off_t pos = 0;
off_t data_end = 0;
uint64_t stripe_size;
rc = llapi_layout_stripe_size_get(layout, &stripe_size);
- if (rc == 0)
- buf_size = stripe_size;
+ if (rc == 0) {
+ /* We like big bufs */
+ if (stripe_size > buf_size)
+ buf_size = stripe_size;
+ else
+ /* Trim to stripe_size multiple */
+ buf_size -= buf_size % stripe_size;
+ }
llapi_layout_free(layout);
}