Skip to content

struct request optimizations

Jens Axboe linux-block 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 14 repliesIn review
  2. v14 patches 5 repliesSuperseded

Changes in v2 from the cover letter

- Add comment on blk_rq_set_deadline() clearing COMPLETE bit. Decided to keep it like that after discussing with Omar, as it doesn't false convey safety wrt completions atomicity.
- Rearrange a tiny bit more, and move CGROUP stuff to the end so that enabling that doesn't screw everything up. Also move hole near INTEGRITY, so that if that does get enabled, we simply fill the hole.
- Improve layout in mq rq filling.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4block: remove REQ_ATOM_POLL_SLEPTblock/blk-mq-debugfs.c block/blk-mq.c block/blk.h +1 more+4 -63 replies
2/4block: add accessors for setting/querying request deadlineblock/blk-mq.c block/blk-timeout.c block/blk.h +1 more+27 -82 replies
3/4block: convert REQ_ATOM_COMPLETE to stealing rq->__deadline bitblock/blk-core.c block/blk-mq-debugfs.c block/blk-mq.c +2 more+11 -226 replies
4/4block: rearrange a few request fields for better cache layoutblock/blk-mq.c include/linux/blkdev.h+25 -223 replies

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchOmar Sandoval
1/4R-b
2/4R-b
3/4
4/4R-b

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

Read the v2 thread

Cover letter [PATCHSET v2 0/4] struct request optimizations

With the latest patchset from Tejun, we grew the request structure a little bit. It's been quite a while since I've taken a look at the layout of the structure, this patchset is a first attempt at doing that.

One advantage of Tejun's patchset is that we no longer rely on the atomic complete flag on blk-mq. We can use that to shuffle some bits, and reclaim the full atomic_flags field.

Cache optimize the layout of struct request a bit, to group things a little more logically. Not a huge shuffle, just a few select members.

We end up doing better in synthetic testing after this, details in the last patch.

Testing with timeouts on blk-mq and the legacy path work fine, no regressions introduced.

Changes since v1:
- Add comment on blk_rq_set_deadline() clearing COMPLETE bit. Decided to keep it like that after discussing with Omar, as it doesn't false convey safety wrt completions atomicity.
- Rearrange a tiny bit more, and move CGROUP stuff to the end so that enabling that doesn't screw everything up. Also move hole near INTEGRITY, so that if that does get enabled, we simply fill the hole.
- Improve layout in mq rq filling.