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