Skip to content

Commit f8bb510

Browse files
wwlliangliangdavem330
authored andcommitted
virtio_net: suppress cpu stall when free_unused_bufs
For multi-queue and large ring-size use case, the following error occurred when free_unused_bufs: rcu: INFO: rcu_sched self-detected stall on CPU. Fixes: 986a4f4 ("virtio_net: multiqueue support") Signed-off-by: Wenliang Wang <wangwenliang.1995@bytedance.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9f699b7 commit f8bb510

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/net/virtio_net.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3560,12 +3560,14 @@ static void free_unused_bufs(struct virtnet_info *vi)
35603560
struct virtqueue *vq = vi->sq[i].vq;
35613561
while ((buf = virtqueue_detach_unused_buf(vq)) != NULL)
35623562
virtnet_sq_free_unused_buf(vq, buf);
3563+
cond_resched();
35633564
}
35643565

35653566
for (i = 0; i < vi->max_queue_pairs; i++) {
35663567
struct virtqueue *vq = vi->rq[i].vq;
35673568
while ((buf = virtqueue_detach_unused_buf(vq)) != NULL)
35683569
virtnet_rq_free_unused_buf(vq, buf);
3570+
cond_resched();
35693571
}
35703572
}
35713573

0 commit comments

Comments
 (0)