sunvdc: fix -EIO issue due to lack of retries
Jens Axboe
maintainerPATCH 1/1 sunvdc: fix -EIO issue due to lack of retries
John reports that since commit:
a11f6ca9aef9 ("sunvdc: Do not spin in an infinite loop when vio_ldc_send() returns EAGAIN")
users of Linux inside Solaris ldom see occasional -EIO errors because the request send loop now times out. The current loop does 10 retries, and inside vio_ldc_send() a further 1000 1usec retries are done as well. Even with 10.5 msec of busy loop retries that's apparently not enough to always succeed.
Rather than introduce continued busy looping, requeue the request and have the delayed queue kicking retry the request after another 10ms. This obviously isn't ideal, but there's seemingly no way to wait for this type of event. And if 10ms of busy looping was not enough to make progress, then presumably this is an edge condition and we just need to guarantee to make forward progress at some later point in time. That's more suitably done through letting the CPU tend to other work, rather than sitting in a tight loop retrying.
---
Caveat: 100% untested, not even compiled. Sending out on John's behest.
drivers/block/sunvdc.c +8 -1
@@ -539,6 +539,7 @@ static blk_status_t vdc_queue_rq(struct blk_mq_hw_ctx *hctx,struct vdc_port *port = hctx->queue->queuedata;struct vio_dring_state *dr;unsigned long flags; +int ret; dr = &port->vio.drings[VIO_DRIVER_TX_RING ];
@@ -560,7 +561,13 @@ static blk_status_t vdc_queue_rq(struct blk_mq_hw_ctx *hctx,return BLK_STS_DEV_RESOURCE ; } -if (__send_request (bd->rq) <0 ) { + ret =__send_request (bd->rq); +if (ret == -EAGAIN ) { +spin_unlock_irqrestore (&port->vio.lock, flags); +/* already spun for 10msec, defer 10msec and retry */ +blk_mq_delay_kick_requeue_list (hctx->queue,10 ); +return BLK_STS_DEV_RESOURCE ; + }else if (ret <0 ) {spin_unlock_irqrestore (&port->vio.lock, flags);return BLK_STS_IOERR ; }
Signature · 1 line
Jens Axboe
Dear patch submitter,
Blktests CI has tested the following submission:
Status: FAILURE Name: sunvdc: fix -EIO issue due to lack of retries Patchwork: https://patchwork.kernel.org/project/linux-block/list/?series=1008721&state=* Run record: https://github.com/linux-blktests/linux-block/actions/runs/18285324490
No failure
Hi,
Quoted 44 lines · Jens Axboe
John reports that since commit:
a11f6ca9aef9("sunvdc: Do not spin in an infinite loop whenvio_ldc_send()returns EAGAIN")users of Linux inside Solaris ldom see occasional
-EIOerrors because the request send loop now times out. The current loop does 10 retries, and insidevio_ldc_send()a further 1000 1usec retries are done as well. Even with 10.5 msec of busy loop retries that's apparently not enough to always succeed.Rather than introduce continued busy looping, requeue the request and have the delayed queue kicking retry the request after another 10ms. This obviously isn't ideal, but there's seemingly no way to wait for this type of event. And if 10ms of busy looping was not enough to make progress, then presumably this is an edge condition and we just need to guarantee to make forward progress at some later point in time. That's more suitably done through letting the CPU tend to other work, rather than sitting in a tight loop retrying.
Reported-by John Paul Adrian Glaubitz <[email protected]>Signed-off-by Jens Axboe <[email protected]>---
Caveat: 100% untested, not even compiled. Sending out on John's behest.
drivers/block/sunvdc.c +1
-1@@ -539,6 +539,7 @@ static blk_status_t vdc_queue_rq(struct blk_mq_hw_ctx *hctx,struct vdc_port *port = hctx->queue->queuedata;struct vio_dring_state *dr;unsigned long flags; +int ret; dr = &port->vio.drings[VIO_DRIVER_TX_RING ];@@ -560,7 +561,13 @@ static blk_status_t vdc_queue_rq(struct blk_mq_hw_ctx *hctx,return BLK_STS_DEV_RESOURCE ; } -if (__send_request (bd->rq) <0 ) {
drivers/block/sunvdc.c static blk_status_t vdc_queue_rq(struct blk_mq_hw_ctx *hctx, · line 573
Quoted 10 lines
drivers/block/sunvdc.c +7
-0+ ret =__send_request (bd->rq); +if (ret == -EAGAIN ) { +spin_unlock_irqrestore (&port->vio.lock, flags); +/* already spun for 10msec, defer 10msec and retry */ +blk_mq_delay_kick_requeue_list (hctx->queue,10 ); +return BLK_STS_DEV_RESOURCE ; + }else if (ret <0 ) {spin_unlock_irqrestore (&port->vio.lock, flags);return BLK_STS_IOERR ; }
I will give this patch a try this week as I finally want to get this fixed.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913