[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: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH 7/7] aio-posix: remove idle poll handlers to improve scalability |
Date: |
Fri, 6 Mar 2020 13:50:36 +0000 |
On Thu, Mar 05, 2020 at 06:28:29PM +0100, Paolo Bonzini wrote:
> On 05/03/20 18:08, Stefan Hajnoczi wrote:
> > + /*
> > + * List of handlers participating in userspace polling. Accessed
> > almost
> > + * exclusively from aio_poll() and therefore not an RCU list.
> > Protected by
> > + * ctx->list_lock.
> > + */
> > + AioHandlerList poll_aio_handlers;
> > +
>
> 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.
Therefore RCU is not needed. ctx->list_lock acts more like a rwlock.
Stefan
signature.asc
Description: PGP signature
- [PATCH 1/7] aio-posix: completely stop polling when disabled, (continued)
- [PATCH 1/7] aio-posix: completely stop polling when disabled, Stefan Hajnoczi, 2020/03/05
- [PATCH 2/7] aio-posix: move RCU_READ_LOCK() into run_poll_handlers(), Stefan Hajnoczi, 2020/03/05
- [PATCH 6/7] aio-posix: support userspace polling of fd monitoring, Stefan Hajnoczi, 2020/03/05
- [PATCH 4/7] aio-posix: simplify FDMonOps->update() prototype, Stefan Hajnoczi, 2020/03/05
- [PATCH 3/7] aio-posix: extract ppoll(2) and epoll(7) fd monitoring, Stefan Hajnoczi, 2020/03/05
- [PATCH 5/7] aio-posix: add io_uring fd monitoring implementation, Stefan Hajnoczi, 2020/03/05
- [PATCH 7/7] aio-posix: remove idle poll handlers to improve scalability, Stefan Hajnoczi, 2020/03/05
Re: [PATCH 0/7] aio-posix: polling scalability improvements, Stefan Hajnoczi, 2020/03/09