On Thu, Dec 12, 2019 at 04:38:47PM +0000, Dr. David Alan Gilbert (git) wrote: > From: Stefan Hajnoczi <stefa...@redhat.com> > > 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 <stefa...@redhat.com> > 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é <berra...@redhat.com> 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 :|