qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH RFC v2 05/22] block/pcache: add aio requests int


From: Pavel Butsykin
Subject: Re: [Qemu-block] [PATCH RFC v2 05/22] block/pcache: add aio requests into cache
Date: Wed, 7 Sep 2016 19:21:54 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 06.09.2016 20:07, Kevin Wolf wrote:
Am 06.09.2016 um 18:54 hat Pavel Butsykin geschrieben:
+        *out_node = found;
+        return false;
+    }
+    atomic_add(&s->pcache.curr_size, new_node->cm.nb_sectors);

atomic_add() implies that you have concurrent threads. I don't see any.

Yeah, but what about iothread? Doesn't presence of iothread lead to
parallel handling of requests in multiple threads?

No, it doesn't. We're running under the AioContext lock.

Yes, you're right. For some reason I thought that there is such a
possibility :)

If we were actually running in parallel threads, your locks might also
be needed, but then they would have to be real thread locks instead of
coroutine locks. But it doesn't happen today, so I think it's best to
ignore.

I agree, use coroutine locks to protect the data was a bad idea.

Kevin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]