Cache issue side time querying
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest4 patches 5 repliesIn review
- v46 patches 7 repliesSuperseded
- v3 RFC6 patches 0 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 RFC | 5 patches | 5 replies | Superseded | |
| v1 RFC | 2 patches | 8 replies | Superseded |
Changes in v5 from the cover letter
- Move time related code to blk.h. This includes both the previous cgroup related time code, but also the new code.
- Drop last two patches
- Ensure sched callback only calls io_wq_worker_running() when PF_IO_WORKER is set.
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | block: move cgroup time handling code into blk.hblock/ block/ include/ | +43 | 1 reply | |
| 2/4 | block: add blk_time_get_ns() and blk_time_get() helpersblock/ block/ block/ +7 more | +56 | 0 replies | |
| 3/4 | block: cache current nsec time in struct blk_plugblock/ block/ include/ | +15 | 0 replies | |
| 4/4 | block: update cached timestamp post schedule/preemptionblock/ block/ include/ +2 more | +26 | 4 replies |
Reviews trailers per patch
All 4 patches have a Reviewed-by or Acked-by.
| Patch | Johannes Thumshirn |
|---|---|
| 1/4 | R-b |
| 2/4 | R-b |
| 3/4 | R-b |
| 4/4 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCHSET v5 0/4] Cache issue side time querying
Hi,
When I run my peak testing to see if we've regressed, my test script always does:
echo 0 > /sys/block/$DEV/queue/iostats
echo 2 > /sys/block/$DEV/queue/nomerges
for each device being used. It's unfortunate that we need to disable iostats, but without doing that, I lose about 12% performance. The main reason for that is the time querying we need to do, when iostats are enabled. As it turns out, lots of other block code is quite trigger happy with querying time as well. We do have some nice batching in place which helps ammortize that, but it's not perfect.
This trivial patchset simply caches the current time in struct blk_plug, on the premise that any issue side time querying can get adequate granularity through that. Nobody really needs nsec granularity on the timestamp.
Results in patch 3, but tldr is a more than 9% improvement (108M -> 118M IOPS) for my test case, which doesn't even enable most of the costly block layer items that you'd typically find in a distro and which would further increase the number of issue side time calls. This brings iostats enabled _almost_ to the level of turning it off.
Can also be found in my block-issue-ts branch:
https://git.kernel.dk/cgit/linux/log/?h=block-issue-ts
block/bfq-cgroup.c | 14 ++++---- block/bfq-iosched.c | 28 ++++++++-------- block/blk-cgroup.c | 2 +- block/blk-cgroup.h | 1 + block/blk-core.c | 3 ++ block/blk-flush.c | 2 +- block/blk-iocost.c | 8 ++--- block/blk-iolatency.c | 6 ++-- block/blk-mq.c | 16 +++++----- block/blk-throttle.c | 6 ++-- block/blk-wbt.c | 6 ++-- block/blk.h | 67 +++++++++++++++++++++++++++++++++++++++ include/linux/blk_types.h | 42 ------------------------ include/linux/blkdev.h | 17 ++++++++++ include/linux/sched.h | 2 +- kernel/sched/core.c | 6 ++-- 16 files changed, 137 insertions(+), 89 deletions(-)
Since v4:
- Move time related code to blk.h. This includes both the previous cgroup related time code, but also the new code.
- Drop last two patches
- Ensure sched callback only calls io_wq_worker_running() when PF_IO_WORKER is set.
Signature · 1 line
Jens Axboe