From: Jeff Moyer <jmoyer@redhat.com>
To: Shaohua Li <shli@fb.com>
Cc: <linux-kernel@vger.kernel.org>, <axboe@fb.com>
Subject: Re: [PATCH] blk: don't account discard request size
Date: Wed, 13 May 2015 09:10:25 -0400 [thread overview]
Message-ID: <x49h9rg62ta.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <10cba6675b3e93f28b9c1c7a21e4b93b923e9531.1431467011.git.shli@fb.com> (Shaohua Li's message of "Tue, 12 May 2015 14:46:27 -0700")
Shaohua Li <shli@fb.com> writes:
> In a workload with discard request, the IO throughput is generally much
> higher than expected. This is quite confusing checking iostat. Discard
> request doesn't really write data to drive, so don't account it.
>
> Signed-off-by: Shaohua Li <shli@fb.com>
> ---
> block/blk-core.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/block/blk-core.c b/block/blk-core.c
> index fd154b9..0128d18 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -2138,7 +2138,11 @@ EXPORT_SYMBOL_GPL(blk_rq_err_bytes);
>
> void blk_account_io_completion(struct request *req, unsigned int bytes)
> {
> - if (blk_do_io_stat(req)) {
> + /*
> + * discard request doesn't really write @bytes to drive,
> + * doesn't account it
> + **/
> + if (blk_do_io_stat(req) && !(req->cmd_flags & REQ_DISCARD)) {
> const int rw = rq_data_dir(req);
> struct hd_struct *part;
> int cpu;
I think you want to modify __get_request to not set REQ_IO_STAT for
discard requests. This patch will still account the start of I/O, which
means in_flight will be off.
Cheers,
Jeff
next prev parent reply other threads:[~2015-05-13 13:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-12 21:46 Shaohua Li
2015-05-13 13:10 ` Jeff Moyer [this message]
2015-05-13 14:20 ` Jens Axboe
2015-05-13 15:00 ` Jeff Moyer
2015-05-13 15:22 ` Jens Axboe
2015-05-13 15:48 ` Jeff Moyer
2015-05-13 15:22 ` Shaohua Li
2015-05-13 15:32 ` Jens Axboe
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=x49h9rg62ta.fsf@segfault.boston.devel.redhat.com \
--to=jmoyer@redhat.com \
--cc=axboe@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shli@fb.com \
/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
all inboxes | Powered by JetHome®