drm/virtio: notify virtqueues without holding spinlock
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 13 Aug 2019 08:25:09 +0000 (10:25 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 28 Aug 2019 07:28:06 +0000 (09:28 +0200)
commit744583ecc3d7c5e27d48ff74e575b893637f4b57
tree96305451b58691edc9b66e8821ce8b9870963e93
parent4100a7b834389e91638a0b789399fd7b31e258c1
drm/virtio: notify virtqueues without holding spinlock

Split virtqueue_kick() call into virtqueue_kick_prepare(), which
requires serialization, and virtqueue_notify(), which does not.  Move
the virtqueue_notify() call out of the critical section protected by the
queue lock.  This avoids triggering a vmexit while holding the lock and
thereby fixes a rather bad spinlock contention.

Suggested-by: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20190813082509.29324-3-kraxel@redhat.com
drivers/gpu/drm/virtio/virtgpu_vq.c