virtio-blk: clamp max_segments when indirect descriptors are disabled - #1140
virtio-blk: clamp max_segments when indirect descriptors are disabled#1140blktests-ci[bot] wants to merge 1 commit into
Conversation
|
Upstream branch: 3aa1dca |
d89ab11 to
fdba928
Compare
|
Upstream branch: fd923b3 |
625e486 to
3dcc987
Compare
|
Upstream branch: fd923b3 |
3dcc987 to
2885cbd
Compare
fdba928 to
60442a3
Compare
|
Upstream branch: 8d3ae59 |
2885cbd to
415506d
Compare
|
Upstream branch: 8d3ae59 |
415506d to
2c28ba2
Compare
60442a3 to
3df366e
Compare
|
Upstream branch: bd5f485 |
2c28ba2 to
c41174f
Compare
When VIRTIO_RING_F_INDIRECT_DESC is not negotiated by the host, every scatter-gather segment in a request must consume a physical slot in the virtqueue ring. If the host does not advertise VIRTIO_BLK_F_SEG_MAX and provides a small virtqueue (e.g. 128 descriptors on QNX Hypervisor), the block layer defaults max_segments to BLK_MAX_SEGMENTS (1024). When a multi-page compound bio arrives from the page cache, virtqueue_add_split() rejects the request with -ENOSPC and triggers: WARNING: at drivers/virtio/virtio_ring.c:1493 virtqueue_add+... WARN_ON_ONCE(total_sg > vq->split.vring.num && !vq->indirect); This permanently wedges the blk-mq queue and blocks all subsequent disk I/O in uninterruptible sleep (D state). Automatically clamp sg_elems to (ring_size - 2) when indirect descriptors are disabled. Signed-off-by: Sergii Ushakov <sergiiushakov@google.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
|
Upstream branch: bd5f485 |
c41174f to
61e14c8
Compare
Pull request for series with
subject: virtio-blk: clamp max_segments when indirect descriptors are disabled
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1146019