Skip to content

block: Fix IO priority mess

Jan Kara linux-block stable 5 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest9 patches 9 repliesApplied
  2. v49 patches 8 repliesSuperseded
  3. v38 patches 12 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v28 patches11 repliesSuperseded
v13 patches10 repliesSuperseded

Changes in v5 from the cover letter

* Added Reviewed-by and Tested-by tags
* Fixed prototype of stub function for !CONFIG_BLOCK

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/9block: fix default IO priority handling againblock/blk-ioc.c block/ioprio.c include/linux/ioprio.h+5 -32 replies
2/9block: Return effective IO priority from get_current_ioprio()include/linux/ioprio.h+9 -21 reply
3/9block: Generalize get_current_ioprio() for any taskblock/ioprio.c include/linux/ioprio.h+36 -161 reply
4/9block: Make ioprio_best() staticblock/ioprio.c include/linux/ioprio.h+1 -61 reply
5/9block: Fix handling of tasks without ioprio in ioprio_get(2)block/ioprio.c+23 -70 replies
6/9blk-ioprio: Remove unneeded fieldblock/blk-ioprio.c+3 -61 reply
7/9blk-ioprio: Convert from rqos policy to direct callblock/blk-cgroup.c block/blk-ioprio.c block/blk-ioprio.h +1 more+23 -451 reply
8/9block: Initialize bio priority earlierblock/blk-mq.c+2 -21 reply
9/9block: Always initialize bio IO priority on submitblock/blk-mq.c+3 -01 reply

Reviews trailers per patch

All 9 patches have a Reviewed-by or Acked-by.

PatchDamien Le MoalChristoph Hellwig
1/9R-b T-b R-b
2/9R-b T-b R-b
3/9R-b T-b R-b
4/9R-b T-b R-b
5/9R-b T-b
6/9R-b T-b R-b
7/9R-b T-b R-b
8/9R-b T-b R-b
9/9R-b T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH 0/9 v5] block: Fix IO priority mess

Hello,

This is the fifth revision of my patches fixing IO priority handling in the block layer. Damien has reviewed all the patches and tested them as well so I think patches are ready to be merged.

Changes since v4:
* Added Reviewed-by and Tested-by tags
* Fixed prototype of stub function for !CONFIG_BLOCK

Changes since v3:
* Added Reviewed-by tags from Damien
* Fixed build failure without CONFIG_BLOCK
* Separated refactoring of get_current_ioprio() into a separate patch

Changes since v2:
* added some comments to better explain things
* changed handling of ioprio_get(2)
* a few small tweaks based on Damien's feedback

Original cover letter:
Recently, I've been looking into 10% regression reported by our performance measurement infrastructure in reaim benchmark that was bisected down to 5a9d041ba2f6 ("block: move io_context creation into where it's needed"). This didn't really make much sense and it took me a while to understand this but the culprit is actually in even older commit e70344c05995 ("block: fix default IO priority handling") and 5a9d041ba2f6 just made the breakage visible. Essentially the problem was that after these commits some IO was queued with IO priority class IOPRIO_CLASS_BE while other IO was queued with IOPRIO_CLASS_NONE and as a result they could not be merged together resulting in performance regression. I think what commit e70344c05995 ("block: fix default IO priority handling") did is actually broken not only because of this performance regression but because of other reasons as well (see changelog of patch 3/8 for details). Besides this problem, there are multiple other inconsistencies in the IO priority handling throughout the block stack we have identified when discussing this with Damien Le Moal. So this patch set aims at fixing all these various issues.

Note that there are a few choices I've made I'm not 100% sold on. In particular the conversion of blk-ioprio from rqos is somewhat disputable since it now incurs a cost similar to blk-throttle in the bio submission fast path (need to load bio->bi_blkg->pd[ioprio_policy.plid]). If people think the removed boilerplate code is not worth the cost, I can certainly go via the "additional rqos hook" path.

Honza
Previous versions: