From 56b5e65efe0001fb5f95e412ee4167363debfc46 Mon Sep 17 00:00:00 2001 From: Xianting Tian Date: Fri, 9 Jun 2023 21:18:16 +0800 Subject: [PATCH] virtio-console: call scheduler when we free unused buffs For virtio-net we were getting CPU stall warnings, and fixed it by calling the scheduler: see f8bb51043945 ("virtio_net: suppress cpu stall when free_unused_bufs"). This driver is similar so theoretically the same logic applies. Signed-off-by: Xianting Tian Message-Id: <20230609131817.712867-3-xianting.tian@linux.alibaba.com> Signed-off-by: Michael S. Tsirkin --- drivers/char/virtio_console.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index b65c809a4e97..5ec4cf4ea919 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1935,6 +1935,7 @@ static void remove_vqs(struct ports_device *portdev) flush_bufs(vq, true); while ((buf = virtqueue_detach_unused_buf(vq))) free_buf(buf, true); + cond_resched(); } portdev->vdev->config->del_vqs(portdev->vdev); kfree(portdev->in_vqs); -- 2.34.1