Commit 212c928
ublk: don't quiesce in ublk_ch_release
ublk_ch_release currently quiesces the device's request_queue while
setting force_abort/fail_io. This avoids data races by preventing
concurrent reads from the I/O path, but is not strictly needed - at this
point, canceling is already set and guaranteed to be observed by any
concurrently executing I/Os, so they will be handled properly even if
the changes to force_abort/fail_io propagate to the I/O path later.
Remove the quiesce/unquiesce calls from ublk_ch_release. This makes the
writes to force_abort/fail_io concurrent with the reads in the I/O path,
so make the accesses atomic.
Before this change, the call to blk_mq_quiesce_queue was responsible for
most (90%) of the runtime of ublk_ch_release. With that call eliminated,
ublk_ch_release runs much faster. Here is a comparison of the total time
spent in calls to ublk_ch_release when a server handling 128 devices
exits, before and after this change:
before: 1.11s
after: 0.09s
Signed-off-by: Uday Shankar <[email protected]>
Reviewed-by: Ming Lei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>1 parent d5dd409 commit 212c928
1 file changed
+5
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1389 | 1389 | | |
1390 | 1390 | | |
1391 | 1391 | | |
1392 | | - | |
| 1392 | + | |
1393 | 1393 | | |
1394 | 1394 | | |
1395 | 1395 | | |
| |||
1401 | 1401 | | |
1402 | 1402 | | |
1403 | 1403 | | |
1404 | | - | |
| 1404 | + | |
| 1405 | + | |
1405 | 1406 | | |
1406 | 1407 | | |
1407 | 1408 | | |
| |||
1644 | 1645 | | |
1645 | 1646 | | |
1646 | 1647 | | |
1647 | | - | |
1648 | 1648 | | |
1649 | 1649 | | |
1650 | 1650 | | |
1651 | 1651 | | |
1652 | 1652 | | |
1653 | 1653 | | |
1654 | 1654 | | |
1655 | | - | |
1656 | | - | |
| 1655 | + | |
1657 | 1656 | | |
1658 | 1657 | | |
1659 | 1658 | | |
| |||
1663 | 1662 | | |
1664 | 1663 | | |
1665 | 1664 | | |
1666 | | - | |
| 1665 | + | |
1667 | 1666 | | |
1668 | | - | |
1669 | 1667 | | |
1670 | 1668 | | |
1671 | 1669 | | |
| |||
0 commit comments