lkml.org 
[lkml]   [2015]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] blk: don't account discard request size
Date
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


\
 
 \ /
  Last update: 2015-05-13 15:41    [W:1.267 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site