mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-15 11:44:11 +00:00
vduse: Use proper spinlock for IRQ injection
[ Upstream commit7ca26efb09
] The IRQ injection work used spin_lock_irq() to protect the scheduling of the softirq, but spin_lock_bh() should be used. With spin_lock_irq(), we noticed delay of more than 6 seconds between the time a NAPI polling work is scheduled and the time it is executed. Fixes:c8a6153b6c
("vduse: Introduce VDUSE - vDPA Device in Userspace") Cc: xieyongji@bytedance.com Suggested-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Message-Id: <20230705114505.63274-1-maxime.coquelin@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Xie Yongji <xieyongji@bytedance.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
1485c1753c
commit
9837e26077
1 changed files with 4 additions and 4 deletions
|
@ -879,10 +879,10 @@ static void vduse_dev_irq_inject(struct work_struct *work)
|
|||
{
|
||||
struct vduse_dev *dev = container_of(work, struct vduse_dev, inject);
|
||||
|
||||
spin_lock_irq(&dev->irq_lock);
|
||||
spin_lock_bh(&dev->irq_lock);
|
||||
if (dev->config_cb.callback)
|
||||
dev->config_cb.callback(dev->config_cb.private);
|
||||
spin_unlock_irq(&dev->irq_lock);
|
||||
spin_unlock_bh(&dev->irq_lock);
|
||||
}
|
||||
|
||||
static void vduse_vq_irq_inject(struct work_struct *work)
|
||||
|
@ -890,10 +890,10 @@ static void vduse_vq_irq_inject(struct work_struct *work)
|
|||
struct vduse_virtqueue *vq = container_of(work,
|
||||
struct vduse_virtqueue, inject);
|
||||
|
||||
spin_lock_irq(&vq->irq_lock);
|
||||
spin_lock_bh(&vq->irq_lock);
|
||||
if (vq->ready && vq->cb.callback)
|
||||
vq->cb.callback(vq->cb.private);
|
||||
spin_unlock_irq(&vq->irq_lock);
|
||||
spin_unlock_bh(&vq->irq_lock);
|
||||
}
|
||||
|
||||
static int vduse_dev_queue_irq_work(struct vduse_dev *dev,
|
||||
|
|
Loading…
Add table
Reference in a new issue