[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
cluster_size got from backup_calculate_cluster_size()
From: |
Derek Su |
Subject: |
cluster_size got from backup_calculate_cluster_size() |
Date: |
Thu, 21 May 2020 17:56:12 +0800 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 |
Hi,
The cluster_size got from backup_calculate_cluster_size(),
MAX(BACKUP_CLUSTER_SIZE_DEFAULT, bdi.cluster_size), is 64K regardless
of the target image's cluster size.
For example:
If the cluster size of source and target qcow2 images are both 16K, the
64K from backup_calculate_cluster_size() results in unwanted copies of
clusters.
The behavior slows down the backup (block-copy) process when the
source image receives lots of rand writes.
Is the following calculation reasonable for the above issue?
```
static int64_t backup_calculate_cluster_size(BlockDriverState *target,
Error **errp)
{
...
ret = bdrv_get_info(target, &bdi);
...
return (bdi.cluster_size == 0 ?
BACKUP_CLUSTER_SIZE_DEFAULT : cluster_size);
}
```
Thanks.
Regards,
Derek
- cluster_size got from backup_calculate_cluster_size(),
Derek Su <=