[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 7/8] block: core copy-on-read logic
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v2 7/8] block: core copy-on-read logic |
Date: |
Wed, 23 Nov 2011 08:58:59 +0000 |
On Wed, Nov 23, 2011 at 4:42 AM, Zhi Yong Wu <address@hidden> wrote:
> On Thu, Nov 17, 2011 at 9:40 PM, Stefan Hajnoczi
> <address@hidden> wrote:
>> + /* Cover entire cluster so no additional backing file I/O is required
>> when
>> + * allocating cluster in the image file.
>> + */
>> + round_to_clusters(bs, sector_num, nb_sectors,
>> + &cluster_sector_num, &cluster_nb_sectors);
> Why need to round down/up sector_num/nb_sectors in this function? The
> detection of race condition for write request has been done before
> this function.
If we write less than a cluster then the image format will have to
perform additional to populate the regions of the cluster that we did
not touch. So we touch entire clusters and therefore no extra I/O is
generated.
The comment right above the line you are asking about explains this.
Stefan
- [Qemu-devel] [PATCH v2 2/8] coroutine: add qemu_co_queue_restart_all(), (continued)
- [Qemu-devel] [PATCH v2 2/8] coroutine: add qemu_co_queue_restart_all(), Stefan Hajnoczi, 2011/11/17
- [Qemu-devel] [PATCH v2 4/8] block: add bdrv_set_copy_on_read(), Stefan Hajnoczi, 2011/11/17
- [Qemu-devel] [PATCH v2 5/8] block: wait for overlapping requests, Stefan Hajnoczi, 2011/11/17
- [Qemu-devel] [PATCH v2 7/8] block: core copy-on-read logic, Stefan Hajnoczi, 2011/11/17
- Re: [Qemu-devel] [PATCH v2 7/8] block: core copy-on-read logic, Zhi Yong Wu, 2011/11/22