qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 7/7] aio-posix: remove idle poll handlers to improve scalabil


From: Paolo Bonzini
Subject: Re: [PATCH 7/7] aio-posix: remove idle poll handlers to improve scalability
Date: Fri, 6 Mar 2020 15:17:40 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 06/03/20 14:50, Stefan Hajnoczi wrote:
>> Not sure I understand the "almost" part.  If it's accessed only from
>> aio_poll() it is protected via either AIO_WAIT_WHILE or the BQL, not by
>> ctx->list_lock; if it's protected by ctx->list_lock (using
>> qemu_lockcnt_inc in readers), it is an RCU list.
> aio_remove_fd_handler() removes nodes from the list during
> aio_set_fd_handler(), but only while holding ctx->list_lock and the
> count is zero (no readers).
> 
> All other access is done from with ctx->list_lock incremented.  This
> code needs to be reentrant in case of nested aio_poll() but nothing else
> will access the list at the same time.

Oh, I see, adds are only done under ctx->list_lock and those are the
part that need the write barriers in the RCU iterators.

Paolo

> Therefore RCU is not needed.  ctx->list_lock acts more like a rwlock.




reply via email to

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