target: fix cmd plugging and submission
Status from this message: Applied to 5.13/scsi-queue, thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest posting 2/225 patches 2 repliesApplied
- v5 posting 1/225 patches 10 repliesSuperseded
- v313 patches 0 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 0 of 12 patches | 0 replies | Superseded | |
| v1 | 11 patches | 16 replies | Superseded |
Changes in v5 from the cover letter
- Add WARN if driver has used simple API and target_stop_session
- Added fix for simple API users (usb, sbp, and xen) for early failure (invalid LUN, write on a RO dev, etc) handling.
Patches in v5 posting 2/2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/25 | target: move t_task_cdb initializationdrivers/ | +1 | 1 reply | |
| 2/25 | target: drop kref_get_unless_zero in target_get_sess_cmddrivers/ | +1 | 0 replies | |
| 3/25 | target: rename transport_init_se_cmddrivers/ drivers/ drivers/ +2 more | +31 | 0 replies | |
| 4/25 | target: break up target_submit_cmd_map_sglsdrivers/ include/ | +148 | 0 replies | |
| 5/25 | srpt: Convert to new submission APIdrivers/ | +8 | 0 replies | |
| 6/25 | ibmvscsi_tgt: Convert to new submission APIdrivers/ | +3 | 0 replies | |
| 7/25 | qla2xxx: Convert to new submission APIdrivers/ | +12 | 0 replies | |
| 8/25 | tcm_loop: Convert to new submission APIdrivers/ | +10 | 0 replies | |
| 9/25 | sbp_target: Convert to new submission APIdrivers/ | +3 | 0 replies | |
| 10/25 | usb gadget: Convert to new submission APIdrivers/ | +6 | 0 replies | |
| 11/25 | vhost-scsi: Convert to new submission APIdrivers/ | +9 | 0 replies | |
| 12/25 | xen-scsiback: Convert to new submission APIdrivers/ | +9 | 0 replies | |
| 13/25 | tcm_fc: Convert to new submission APIdrivers/ | +10 | 0 replies | |
| 14/25 | target: remove target_submit_cmd_map_sglsdrivers/ include/ | +18 | 0 replies | |
| 15/25 | target: add gfp_t arg to target_cmd_init_cdbdrivers/ drivers/ drivers/ +7 more | +23 | 0 replies | |
| 16/25 | target: add workqueue based cmd submissiondrivers/ drivers/ drivers/ +2 more | +59 | 0 replies | |
| 17/25 | vhost scsi: use lio wq cmd submission helperdrivers/ | +6 | 0 replies | |
| 18/25 | tcm loop: use blk cmd allocator for se_cmdsdrivers/ | +8 | 0 replies | |
| 19/25 | tcm loop: use lio wq cmd submission helperdrivers/ drivers/ | +6 | 0 replies | |
| 20/25 | target: cleanup cmd flag bitsinclude/ | +19 | 0 replies | |
| 21/25 | target: fix backend pluggingdrivers/ include/ include/ | +48 | 0 replies | |
| 22/25 | target iblock: add backend plug/unplug calloutsdrivers/ drivers/ | +53 | 0 replies | |
| 23/25 | target_core_user: add backend plug/unplug calloutsdrivers/ | +25 | 0 replies | |
| 24/25 | target: flush submission work during TMR processingdrivers/ | +4 | 0 replies | |
| 25/25 | target: make completion affinity configurabledrivers/ drivers/ drivers/ +1 more | +77 | 0 replies |
Reviews trailers per patch
23 of 25 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Christoph Hellwig | Laurence Oberman | Bodo Stroesser | Himanshu Madhani | Bart Van Assche | Chaitanya Kulkarni | Stefan Hajnoczi |
|---|---|---|---|---|---|---|---|
| Series | R-b | ||||||
| 1/25 | R-b | T-b | R-b | ||||
| 2/25 | R-b | T-b | R-b | ||||
| 3/25 | R-b | R-b | |||||
| 4/25 | R-b | T-b | R-b | ||||
| 5/25 | R-b | R-b | |||||
| 6/25 | R-b | ||||||
| 7/25 | R-b | T-b | R-b | ||||
| 8/25 | R-b | T-b | |||||
| 9/25 | R-b | ||||||
| 10/25 | R-b | ||||||
| 11/25 | R-b | ||||||
| 12/25 | R-b | ||||||
| 13/25 | R-b | ||||||
| 14/25 | T-b | R-b | |||||
| 15/25 | R-b | T-b | |||||
| 16/25 | T-b | R-b | |||||
| 17/25 | |||||||
| 18/25 | R-b | T-b | |||||
| 19/25 | T-b | R-b | |||||
| 20/25 | R-b | R-b | R-b | ||||
| 21/25 | R-b | ||||||
| 22/25 | |||||||
| 23/25 | R-b | ||||||
| 24/25 | T-b | R-b | |||||
| 25/25 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 7 reviewers.
Cover letter [PATCH 00/25 V5] target: fix cmd plugging and submission
The following patches were made over Martin's 5.12 branches to handle conflicts with the in_interrupt changes.
The patches fix the following issues:
1. target_core_iblock plugs and unplugs the queue for every command. To handle this issue and handle an issue that vhost-scsi and loop were avoiding by adding their own workqueue, I added a new submission workqueue to LIO. Drivers can pass cmds to it, and we can then submit batches of cmds.
2. vhost-scsi and loop on the submission side were doing a work per cmd but because we can block in the block layer on resources like tags we can end up creating lots of threads that will fight each other. In this patchset I just use a cmd list per device to avoid abusing the workueue layer and to better batch the cmds to the lower layers.
The combined patchset fixes a major perf issue we've been hitting with vhost-scsi where IOPs were stuck at 230K when running:
fio --filename=/dev/sda --direct=1 --rw=randrw --bs=4k
--ioengine=libaio --iodepth=128 --numjobs=8 --time_based
--group_reporting --runtime=60The patches in this set get me to 350K when using devices that have native IOPs of around 400-500K.
3. Fix target_submit* error handling. While handling Christoph's comment to kill target_submit_cmd_map_sgls I hit several bugs that are now also fixed up.
V6:
- Fix gfp function arg comment.
- Drop part of git commit message about xcopy using GFP_KERNEL.
- Allow user to pass in specific CPU to do completions on.
V5:
- Add WARN if driver has used simple API and target_stop_session
- Added fix for simple API users (usb, sbp, and xen) for early failure (invalid LUN, write on a RO dev, etc) handling.
V4:
- Fixed the target_submit error handling.
- Dropped get_cdb callback.
- Fixed kernel robot errors for incorrect return values and unused variables.
- Used flush instead of cancel to fix bug in tmr code.
- Fixed race in tcmu.
- Made completion affinity handling a configfs setting
- Dropped patch that added the per device work lists. It really helped a lot for higher perf initiators and tcm loop but only gave around a 5% boost to other drivers. So I dropped it for now to see if there is something more generic we can do.
V3:
- Fix rc type in target_submit so its a sense_reason_t
- Add BUG_ON if caller uses target_queue_cmd_submit but hasn't implemented get_cdb.
- Drop unused variables in loop.
- Fix race in tcmu plug check
- Add comment about how plug check works in iblock
- Do a flush when handling TMRs instead of cancel
V2:
- Fix up container_of use coding style
- Handle offlist review comment from Laurence where with the original code and my patches we can hit a bug where the cmd times out, LIO starts up the TMR code, but it misses the cmd because it's on the workqueue.
- Made the work per device work instead of session to handle the previous issue and so if one dev hits some issue it sleeps on, it won't block other devices.