qemu-block
[Top][All Lists]
Advanced

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

Re: [RFC PATCH 0/5] Removal of AioContext lock, bs->parents and ->childr


From: Paolo Bonzini
Subject: Re: [RFC PATCH 0/5] Removal of AioContext lock, bs->parents and ->children: proof of concept
Date: Wed, 30 Mar 2022 18:02:10 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

On 3/30/22 12:53, Hanna Reitz wrote:

Seems a good compromise between drains and rwlock. What do you think?

Well, sounds complicated.  So I’m asking myself whether this would be noticeably better than just an RwLock for graph modifications, like the global lock Vladimir has proposed.

A global lock would have to be taken by all iothreads on every I/O operation, even a read-write lock would scale because it has a global CoMutex inside and rdlock/unlock both take it. Even if the critical section is small, the cacheline bumping would be pretty bad.

Perhaps we could reuse the code in cpus-common.c, which relies on a list of possible readers and is quite cheap (two memory barriers basically) for writers. Here we would have a list of AioContexts as the possible readers.

The slow path uses a QemuMutex, a QemuCond for the readers and a QemuCond for the writers. The reader QemuCond can be replaced by a CoQueue, I think.

Paolo



reply via email to

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