Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965312AbbEMNKc (ORCPT ); Wed, 13 May 2015 09:10:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38731 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964958AbbEMNK3 (ORCPT ); Wed, 13 May 2015 09:10:29 -0400 From: Jeff Moyer To: Shaohua Li Cc: , Subject: Re: [PATCH] blk: don't account discard request size References: <10cba6675b3e93f28b9c1c7a21e4b93b923e9531.1431467011.git.shli@fb.com> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 X-PCLoadLetter: What the f**k does that mean? Date: Wed, 13 May 2015 09:10:25 -0400 In-Reply-To: <10cba6675b3e93f28b9c1c7a21e4b93b923e9531.1431467011.git.shli@fb.com> (Shaohua Li's message of "Tue, 12 May 2015 14:46:27 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1371 Lines: 40 Shaohua Li 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 > --- > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/