Re: [RFC PATCH 3/3] blk-mq: Remove generation seqeunce

Bart Van Assche
2018-07-19T16:04:46Z

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-7", Size: 1662 bytes --]

On Thu, 2018-07-19 at 09:56 -0600, Keith Busch wrote:
+AD4- Even some scsi drivers are susceptible to losing their requests with =
the
+AD4- reverted behavior: take virtio-scsi for example, which returns RESET+=
AF8-TIMER
+AD4- from it's timeout handler. With the behavior everyone seems to want,
+AD4- a natural completion at or around the same time is lost forever becau=
se
+AD4- it was blocked from completion with no way to recover.

The patch I had posted handles a completion that occurs while a timeout is
being handled properly. From https://www.mail-archive.com/linux-block+AEA-v=
ger.kernel.org/msg22196.html:

void blk+AF8-mq+AF8-complete+AF8-request(struct request +ACo-rq)
+AFs- ... +AF0-
+- if (blk+AF8-mq+AF8-change+AF8-rq+AF8-state(rq, MQ+AF8-RQ+A=
F8-IN+AF8-FLIGHT,
+- MQ+AF8-RQ+AF8-COMPLETE)) +AHs-
+- +AF8AXw-blk+AF8-mq+AF8-complete+AF8-request(rq)+AD=
s-
+- break+ADs-
+- +AH0-
+- if (blk+AF8-mq+AF8-change+AF8-rq+AF8-state(rq, MQ+AF8-RQ+A=
F8-TIMED+AF8-OUT, MQ+AF8-RQ+AF8-COMPLETE))
+- break+ADs-
+AFs- ... +AF0-
+AEAAQA- -838,25 +-838,42 +AEAAQA- static void blk+AF8-mq+AF8-rq+AF8-timed+=
AF8-out(struct request +ACo-req, bool reserved)
+AFs- ... +AF0-
case BLK+AF8-EH+AF8-RESET+AF8-TIMER:
+AFs- ... +AF0-
+- if (blk+AF8-mq+AF8-rq+AF8-state(req) +AD0APQ- MQ+A=
F8-RQ+AF8-COMPLETE) +AHs-
+- +AF8AXw-blk+AF8-mq+AF8-complete+AF8-reques=
t(req)+ADs-
+- break+ADs-
+- +AH0-

Bart.=