[Qemu-devel] [PATCH v4 03/11] block: allow serialized reads to intersect

Vladimir Sementsov-Ogievskiy posted 11 patches 7 years ago
There is a newer version of this series
[Qemu-devel] [PATCH v4 03/11] block: allow serialized reads to intersect
Posted by Vladimir Sementsov-Ogievskiy 7 years ago
Otherwise, if we have serialized read-part in copy_range from backing
file to its parent if CoW take place, this CoW's sub-reads will
intersect with firstly created serialized read request.

Anyway, reads should not influence on disk view, let's allow them to
intersect.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 block/io.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/io.c b/block/io.c
index bd9d688f8b..d4e46cb3dc 100644
--- a/block/io.c
+++ b/block/io.c
@@ -735,7 +735,8 @@ static bool coroutine_fn wait_serialising_requests(BdrvTrackedRequest *self)
         retry = false;
         qemu_co_mutex_lock(&bs->reqs_lock);
         QLIST_FOREACH(req, &bs->tracked_requests, list) {
-            if (req == self || (!req->serialising && !self->serialising)) {
+            if (req == self || (!req->serialising && !self->serialising) ||
+                (self->type == BDRV_TRACKED_READ && req->type == self->type)) {
                 continue;
             }
             if (tracked_request_overlaps(req, self->overlap_offset,
-- 
2.18.0


Re: [Qemu-devel] [PATCH v4 03/11] block: allow serialized reads to intersect
Posted by Kevin Wolf 6 years, 12 months ago
Am 15.10.2018 um 18:06 hat Vladimir Sementsov-Ogievskiy geschrieben:
> Otherwise, if we have serialized read-part in copy_range from backing
> file to its parent if CoW take place, this CoW's sub-reads will
> intersect with firstly created serialized read request.
> 
> Anyway, reads should not influence on disk view, let's allow them to
> intersect.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

What about reads that internally trigger writes, such as copy-on-read?

Kevin

Re: [Qemu-devel] [PATCH v4 03/11] block: allow serialized reads to intersect
Posted by Vladimir Sementsov-Ogievskiy 6 years, 12 months ago
06.11.2018 20:57, Kevin Wolf wrote:
> Am 15.10.2018 um 18:06 hat Vladimir Sementsov-Ogievskiy geschrieben:
>> Otherwise, if we have serialized read-part in copy_range from backing
>> file to its parent if CoW take place, this CoW's sub-reads will
>> intersect with firstly created serialized read request.
>>
>> Anyway, reads should not influence on disk view, let's allow them to
>> intersect.
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> What about reads that internally trigger writes, such as copy-on-read?

oops :). yes, I've to rethink this thing.

>
> Kevin


-- 
Best regards,
Vladimir