]> git.baikalelectronics.ru Git - kernel.git/commit
vhost: fix IOTLB locking
authorJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Fri, 30 Nov 2018 16:05:53 +0000 (16:05 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Dec 2018 23:52:30 +0000 (15:52 -0800)
commitb054100bad6aea265270f3cc368bfb0e0f391ce6
tree44b0e172af8f8621f15351aa2307642ba6fe25cf
parentf63c708718df426063115e80b14dcf0b5588697e
vhost: fix IOTLB locking

Commit 6ecc039be5f7 ("net: vhost: lock the vqs one by one") moved the vq
lock to improve scalability, but introduced a possible deadlock in
vhost-iotlb. vhost_iotlb_notify_vq() now takes vq->mutex while holding
the device's IOTLB spinlock. And on the vhost_iotlb_miss() path, the
spinlock is taken while holding vq->mutex.

Since calling vhost_poll_queue() doesn't require any lock, avoid the
deadlock by not taking vq->mutex.

Fixes: 6ecc039be5f7 ("net: vhost: lock the vqs one by one")
Acked-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/vhost/vhost.c