[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 087/104] virtiofsd: prevent fv_queue_thread() vs virtio_loop(
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH 087/104] virtiofsd: prevent fv_queue_thread() vs virtio_loop() races |
Date: |
Tue, 7 Jan 2020 12:02:29 +0000 |
User-agent: |
Mutt/1.12.1 (2019-06-15) |
On Thu, Dec 12, 2019 at 04:38:47PM +0000, Dr. David Alan Gilbert (git) wrote:
> From: Stefan Hajnoczi <address@hidden>
>
> We call into libvhost-user from the virtqueue handler thread and the
> vhost-user message processing thread without a lock. There is nothing
> protecting the virtqueue handler thread if the vhost-user message
> processing thread changes the virtqueue or memory table while it is
> running.
>
> This patch introduces a read-write lock. Virtqueue handler threads are
> readers. The vhost-user message processing thread is a writer. This
> will allow concurrency for multiqueue in the future while protecting
> against fv_queue_thread() vs virtio_loop() races.
>
> Note that the critical sections could be made smaller but it would be
> more invasive and require libvhost-user changes. Let's start simple and
> improve performance later, if necessary. Another option would be an
> RCU-style approach with lighter-weight primitives.
>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> Merged with log changes
> pull request 12
Two extraneous lines
> ---
> tools/virtiofsd/fuse_virtio.c | 34 +++++++++++++++++++++++++++++++++-
> 1 file changed, 33 insertions(+), 1 deletion(-)
Reviewed-by: Daniel P. Berrangé <address@hidden>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH 087/104] virtiofsd: prevent fv_queue_thread() vs virtio_loop() races,
Daniel P . Berrangé <=