From: Xianting Tian Date: Fri, 9 Jun 2023 13:18:16 +0000 (+0800) Subject: virtio-console: call scheduler when we free unused buffs X-Git-Tag: nvme-6.5-2023-07-13~31^2~20 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=56b5e65efe0001fb5f95e412ee4167363debfc46;p=nvme.git 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 --- 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);