Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <xianting.tian@linux.alibaba.com>
Message-Id: <20230609131817.712867-3-xianting.tian@linux.alibaba.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

authored by

Xianting Tian and committed by
Michael S. Tsirkin
56b5e65e 7a5103b8

+1
+1
drivers/char/virtio_console.c
··· 1935 1935 flush_bufs(vq, true); 1936 1936 while ((buf = virtqueue_detach_unused_buf(vq))) 1937 1937 free_buf(buf, true); 1938 + cond_resched(); 1938 1939 } 1939 1940 portdev->vdev->config->del_vqs(portdev->vdev); 1940 1941 kfree(portdev->in_vqs);