[PATCH 0/2] virtio-blk: Avoid processing requests on the main context on restart

Sergio Lopez posted 2 patches 3 years, 11 months ago
Test docker-mingw@fedora passed
Test checkpatch passed
Test asan passed
Test docker-quick@centos7 passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200603093240.40489-1-slp@redhat.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Max Reitz <mreitz@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>
include/hw/virtio/virtio-blk.h  |  1 +
hw/block/dataplane/virtio-blk.c |  8 ++++++++
hw/block/virtio-blk.c           | 30 +++++++++++++++++++++---------
3 files changed, 30 insertions(+), 9 deletions(-)
[PATCH 0/2] virtio-blk: Avoid processing requests on the main context on restart
Posted by Sergio Lopez 3 years, 11 months ago
On restart, we were scheduling a BH to process queued requests, which
would run before starting up the data plane, leading to those requests
being assigned and started on coroutines on the main context.

This could cause requests to be wrongly processed in parallel from
different threads (the main thread and the iothread managing the data
plane), potentially leading to multiple issues.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1812765

See "virtio-blk: Disable request queuing while switching contexts" for
previous discussion:

 - https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg00304.html

Sergio Lopez (2):
  virtio-blk: Refactor the code that processes queued requests
  virtio-blk: On restart, process queued requests in the proper context

 include/hw/virtio/virtio-blk.h  |  1 +
 hw/block/dataplane/virtio-blk.c |  8 ++++++++
 hw/block/virtio-blk.c           | 30 +++++++++++++++++++++---------
 3 files changed, 30 insertions(+), 9 deletions(-)

-- 
2.26.2



Re: [PATCH 0/2] virtio-blk: Avoid processing requests on the main context on restart
Posted by Kevin Wolf 3 years, 11 months ago
Am 03.06.2020 um 11:32 hat Sergio Lopez geschrieben:
> On restart, we were scheduling a BH to process queued requests, which
> would run before starting up the data plane, leading to those requests
> being assigned and started on coroutines on the main context.
> 
> This could cause requests to be wrongly processed in parallel from
> different threads (the main thread and the iothread managing the data
> plane), potentially leading to multiple issues.
> 
> Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1812765
> 
> See "virtio-blk: Disable request queuing while switching contexts" for
> previous discussion:
> 
>  - https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg00304.html

Thanks, applied to the block branch.

Kevin