From: Omar Sandoval <osandov@osandov.com>
To: linux-block@vger.kernel.org
Cc: Jens Axboe <axboe@fb.com>,
kernel-team@fb.com, Josef Bacik <josef@toxicpanda.com>
Subject: [PATCH v2 0/7] block: consolidate struct request timestamp fields
Date: Wed, 2 May 2018 14:32:38 -0700 [thread overview]
Message-ID: <cover.1525296089.git.osandov@fb.com> (raw)
From: Omar Sandoval <osandov@fb.com>
Josef mentioned that his upcoming cgroups io controller uses
blk_issue_stat, so moving it to be private to blk-throtl would cause him
some pain. v2 changes patch 3 to replace bi_issue_stat with a new type
with the same helpers (I didn't want to keep the naming because it no
longer has anything to do with blk-stats).
Cover letter from v1:
Currently, struct request has four timestamp fields:
- start_time (jiffies), marked at get_request() time and used for
iostats
- issue_stat (ktime nanoseconds, with some bits shared with wbt and
io.low), marked at start_request() time and used for accounting the
time spent in the device for blk-stats (i.e., wbt, kyber, hybrid
polling)
- start_time_ns (sched_clock nanoseconds), also marked at get_request()
time, used for CFQ and BFQ cgroups support
- io_start_time_ns (sched_clock nanoseconds), also marked at
start_request() time and also used for CFQ and BFQ
Clearly, there's some redundancy here. This patch series consolidates
these four timestamps into two, both of which are in ktime nanoseconds.
This shaves off up to 16 bytes from struct request, gets rid of the
usage of sched_clock(), and actually removes lines of code.
Patches 1 and 2 do some prep in wbt. Patch 3 does some prep in io.low.
Patch 4 splits up issue_stat into just a timestamp and separate fields
to fill a hole in struct request. Patch 5 does some prep in CFQ and BFQ.
Patch 6 allows us to save a call to ktime_get(). Patch 7 does the final
consolidation.
Please take a look. I added a blktest (block/018) to sanity check
iostats, but other stuff is harder to test so it could use some eyes.
Thanks!
Omar Sandoval (7):
block: move some wbt helpers to blk-wbt.c
block: pass struct request instead of struct blk_issue_stat to wbt
block: replace bio->bi_issue_stat with bio-specific type
block: get rid of struct blk_issue_stat
block: use ktime_get_ns() instead of sched_clock() for cfq and bfq
block: move blk_stat_add() to __blk_mq_end_request()
block: consolidate struct request timestamp fields
block/bfq-cgroup.c | 40 ++++++++++++------------
block/bfq-iosched.c | 4 +--
block/bfq-iosched.h | 10 +++---
block/blk-core.c | 32 +++++++++++---------
block/blk-merge.c | 11 +++----
block/blk-mq.c | 33 +++++++++++---------
block/blk-stat.c | 10 ++----
block/blk-stat.h | 45 +--------------------------
block/blk-throttle.c | 22 ++++++--------
block/blk-wbt.c | 59 +++++++++++++++++++++++-------------
block/blk-wbt.h | 47 +++++++++-------------------
block/blk.h | 2 +-
block/cfq-iosched.c | 64 ++++++++++++++++++---------------------
block/kyber-iosched.c | 6 ++--
drivers/md/dm-rq.c | 2 +-
include/linux/blk_types.h | 49 ++++++++++++++++++++++++++++--
include/linux/blkdev.h | 61 +++++++++----------------------------
17 files changed, 228 insertions(+), 269 deletions(-)
--
2.17.0
next reply other threads:[~2018-05-02 21:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-02 21:32 Omar Sandoval [this message]
2018-05-02 21:32 ` [PATCH v2 1/7] block: move some wbt helpers to blk-wbt.c Omar Sandoval
2018-05-02 21:32 ` [PATCH v2 2/7] block: pass struct request instead of struct blk_issue_stat to wbt Omar Sandoval
2018-05-02 21:32 ` [PATCH v2 3/7] block: replace bio->bi_issue_stat with bio-specific type Omar Sandoval
2018-05-02 21:32 ` [PATCH v2 4/7] block: get rid of struct blk_issue_stat Omar Sandoval
2018-05-02 21:32 ` [PATCH v2 5/7] block: use ktime_get_ns() instead of sched_clock() for cfq and bfq Omar Sandoval
2018-05-02 21:32 ` [PATCH v2 6/7] block: move blk_stat_add() to __blk_mq_end_request() Omar Sandoval
2018-05-02 21:32 ` [PATCH v2 7/7] block: consolidate struct request timestamp fields Omar Sandoval
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1525296089.git.osandov@fb.com \
--to=osandov@osandov.com \
--cc=axboe@fb.com \
--cc=josef@toxicpanda.com \
--cc=kernel-team@fb.com \
--cc=linux-block@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).