[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: |
Zhi Yong Wu |
Subject: |
Re: [Qemu-devel] [PATCH v2 7/8] block: core copy-on-read logic |
Date: |
Wed, 23 Nov 2011 17:51:42 +0800 |
On Wed, Nov 23, 2011 at 5:05 PM, Stefan Hajnoczi <address@hidden> wrote:
> On Wed, Nov 23, 2011 at 3:42 AM, Zhi Yong Wu <address@hidden> wrote:
>> On Thu, Nov 17, 2011 at 9:40 PM, Stefan Hajnoczi
>> <address@hidden> wrote:
>>> tracked_request_begin(&req, bs, sector_num, nb_sectors, false);
>>> +
>>> + if (bs->copy_on_read) {
>> Why is tracked_request_begin/end() not put inside the brace around
>> bs->copy_on_read?
>> If this COR function is not enabled, i guess that request tracing
>> function should not be need.
>
> It's not safe to put the calls inside the "if (bs->copy_on_read) {"
> body because turning off copy_on_read while a request is pending would
> leave the request in the tracked list forever!
GOT IT, thanks.
>
> In a previous version of the series there was a flag to turn request
> tracking on/off. Pending requests would still remove themselves from
> the list even after request tracking was disabled.
>
> But request tracking is cheap - it involves filling in fields on the
> stack and adding them to a linked list. So to keep things simple we
> always maintain this list.
>
> Stefan
>
--
Regards,
Zhi Yong Wu
- [Qemu-devel] [PATCH v2 8/8] block: add -drive copy-on-read=on|off, (continued)
- [Qemu-devel] [PATCH v2 8/8] block: add -drive copy-on-read=on|off, Stefan Hajnoczi, 2011/11/17
- [Qemu-devel] [PATCH v2 3/8] block: add request tracking, Stefan Hajnoczi, 2011/11/17
- [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