Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1235757imm; Tue, 5 Jun 2018 11:07:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJZv3g0pOd4cCB05fyHHOd/EyfFGRWljZqo5ce7TASa+hGYuKSlws15hrJAWdRI49MneANV X-Received: by 2002:a65:4b82:: with SMTP id t2-v6mr21421107pgq.175.1528222071261; Tue, 05 Jun 2018 11:07:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528222071; cv=none; d=google.com; s=arc-20160816; b=yEX7D89lktmrsstRftgoD1eh/00A2nSORgkMAw2Q0UpGlm1vqhZE2YmQZHpUl8xUvd Dx5/bKf1Yi/AlVJvUGtDlh8kkPvLn0chIDIghBNPhDNTD+QxA2pLfk36sL+Umg1CSrsq Z2Oqb4UuD6OiDPh7jcXP+x1d2N5AkcUXw66IGIAzO0mT15q6pWu8aGhlofqNh4gLgFzB vs3oZt5XeGmWH65oDoHZPyXqnrPlSXaq/DC89GNwca4uQeqoAsW3XIYHYdt/wT+zg/br E6a7SF8Q7XkmOt7XXRhJCsgwFELKRb+kvJYxAfXHN2z3gRYPgvSPLaVDzY4RdHu+S9oP b1lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=7E2aKrIH9ewz+M6s46rYu9mSwrRKMnEFbYDT0jo3DDM=; b=u6DFCJ4G817bgdsWunhHG0g2h5Dncm8VSVbCMBNhBPU5j5Xhr4KQE+c1iU293fbLc7 NcU9gdUaFeGw7DKTxHuQDmoQAPH3cC/giIIQ8fE7cq+xvBYnLvMoXj4iZ1e7pf3m8E82 eLWETrC9gBHfVsNK3sjA+Har00CtRiuOKl9pRkuMKhytHS3Yc2RNgmioS2/5S9xmFnpQ XneINQBgDsYv/HZdtQm3NsV1Fknzi28k/Kmy5MQSzbz04lhHwlEzFPeJNLaKs7gVyuTy iEze6A4cson+LArA5bKKYqfEBMPC36YYf1Bi7Ids3DgoyOGb/Mw27CXIQjXmSKhW3pcM lGVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=jkxN7Riz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p8-v6si11805760pgd.96.2018.06.05.11.07.36; Tue, 05 Jun 2018 11:07:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=jkxN7Riz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752629AbeFESHP (ORCPT + 99 others); Tue, 5 Jun 2018 14:07:15 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:35407 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752217AbeFESHN (ORCPT ); Tue, 5 Jun 2018 14:07:13 -0400 Received: by mail-lf0-f65.google.com with SMTP id y72-v6so5020462lfd.2 for ; Tue, 05 Jun 2018 11:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=7E2aKrIH9ewz+M6s46rYu9mSwrRKMnEFbYDT0jo3DDM=; b=jkxN7RizqHT15lpgSOF0/vosbzrYb19Fmbl/PwSldi0HufysnHL0rSQIvJxsRZAex+ zF/kMPvz2vNb2X1QUjO4Q87zI4AlPS8xnSqP2AhKc5HSAWYY4Us+4ohY8eUblNpFMtSs kKKTA+fq3vyxP/pcvs2ddS2Wbpf6PqiUJM3Ww49iF33BnMXhf5iEFyJrzcqYAOl532Ic wfOzwFkxrFeZPt47C9t5EjQ2w9MaYAbndYo50V80y75GYfIlpZrZtCsNLlxNM/fjru/i kcgmLiLGjaRipzIloQL4WBSi0HgnatPJX4FEs7XNIox28M/WwJcFUKAIwAf7KdVLX34b Q3KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7E2aKrIH9ewz+M6s46rYu9mSwrRKMnEFbYDT0jo3DDM=; b=H/CZ54qe+vPmawlm1yF9ZzMkuibQvmzb1sNAfTtnoEuH1zREVtOGXw5c2dM3gcdGIH c6uTPbVhE4vXghcGsXXR8qM3dWdSIJsfZ8yy3UYdC1GsfAe/xmYvkEUiyz1FnWml+jxt +2lyVOzseBQncXXHXXy6ewYM7Aetx+MUMqCt/nYBn/AOsV4zPwcbUyvH4PI94JR8AW6q VSnvjhNhd87PsKZx4a2FAEIYNo7TvLq0snaeOK4LVKt3QDIq1J5aivdWrciNkP4VnhIh S8oIkXZzSHXgKvYSRGZ5Ypx+yYQ1qgdeaOIf1Nd8S+zoCxfoV0YmOSN2fXVj4xG31hEG qw2Q== X-Gm-Message-State: APt69E3PtSfyts0YQ4ahFt8YOH5CGW0tf5gz7wwydOX5bEFXcqF3al4o RowPoP9GYoMiE7EfkFkpkpuyhg== X-Received: by 2002:a19:eb4d:: with SMTP id j74-v6mr2184940lfh.1.1528222031631; Tue, 05 Jun 2018 11:07:11 -0700 (PDT) Received: from [192.168.0.10] (95-166-82-66-cable.dk.customer.tdc.net. [95.166.82.66]) by smtp.googlemail.com with ESMTPSA id s4-v6sm2146972ljs.38.2018.06.05.11.07.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jun 2018 11:07:10 -0700 (PDT) Subject: Re: [PATCH 4/6] block: Add and use op_stat_group() for indexing disk_stat fields. To: Tejun Heo , axboe@kernel.dk Cc: michaelcallahan@fb.com, newella@fb.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, Minchan Kim , Dan Williams , Joshua Morris , Philipp Reisner , Kent Overstreet , Alasdair Kergon References: <20180605180120.2726113-1-tj@kernel.org> <20180605180120.2726113-5-tj@kernel.org> From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: <664313c6-3cb9-e4fd-ba57-e9b7ff5bcb78@lightnvm.io> Date: Tue, 5 Jun 2018 20:07:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180605180120.2726113-5-tj@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/05/2018 08:01 PM, Tejun Heo wrote: > From: Michael Callahan > > Add and use a new op_stat_group() function for indexing partition stat > fields rather than indexing them by rq_data_dir() or bio_data_dir(). > This function works similarly to op_is_sync() in that it takes the > request::cmd_flags or bio::bi_opf flags and determines which stats > should et updated. > > In addition, the second parameter to generic_start_io_acct() and > generic_end_io_acct() is now a REQ_OP rather than simply a read or > write bit and it uses op_stat_group() on the parameter to determine > the stat group. > > Note that the partition in_flight counts are not part of the per-cpu > statistics and as such are not indexed via this function. It's now > indexed by op_is_write(). > > tj: Refreshed on top of v4.17. Updated to pass around REQ_OP. > > Signed-off-by: Michael Callahan > Signed-off-by: Tejun Heo > Cc: Minchan Kim > Cc: Dan Williams > Cc: Joshua Morris > Cc: Philipp Reisner > Cc: Matias Bjorling > Cc: Kent Overstreet > Cc: Alasdair Kergon > --- > block/bio.c | 16 +++++++++------- > block/blk-core.c | 12 ++++++------ > drivers/block/drbd/drbd_req.c | 4 ++-- > drivers/block/rsxx/dev.c | 6 +++--- > drivers/block/zram/zram_drv.c | 5 ++--- > drivers/lightnvm/pblk-cache.c | 5 +++-- > drivers/lightnvm/pblk-read.c | 5 +++-- > drivers/md/bcache/request.c | 13 +++++-------- > drivers/md/dm.c | 6 ++++-- > drivers/md/md.c | 5 +++-- > drivers/nvdimm/nd.h | 7 +++---- > include/linux/bio.h | 4 ++-- > include/linux/blk_types.h | 5 +++++ > 13 files changed, 50 insertions(+), 43 deletions(-) > > diff --git a/block/bio.c b/block/bio.c .... > diff --git a/drivers/lightnvm/pblk-cache.c b/drivers/lightnvm/pblk-cache.c > index b1c6d7e..643e276 100644 > --- a/drivers/lightnvm/pblk-cache.c > +++ b/drivers/lightnvm/pblk-cache.c > @@ -27,7 +27,8 @@ int pblk_write_to_cache(struct pblk *pblk, struct bio *bio, unsigned long flags) > int nr_entries = pblk_get_secs(bio); > int i, ret; > > - generic_start_io_acct(q, WRITE, bio_sectors(bio), &pblk->disk->part0); > + generic_start_io_acct(q, REQ_OP_WRITE, bio_sectors(bio), > + &pblk->disk->part0); > > /* Update the write buffer head (mem) with the entries that we can > * write. The write in itself cannot fail, so there is no need to > @@ -75,7 +76,7 @@ int pblk_write_to_cache(struct pblk *pblk, struct bio *bio, unsigned long flags) > pblk_rl_inserted(&pblk->rl, nr_entries); > > out: > - generic_end_io_acct(q, WRITE, &pblk->disk->part0, start_time); > + generic_end_io_acct(q, REQ_OP_WRITE, &pblk->disk->part0, start_time); > pblk_write_should_kick(pblk); > return ret; > } > diff --git a/drivers/lightnvm/pblk-read.c b/drivers/lightnvm/pblk-read.c > index 1869469..cf90cee 100644 > --- a/drivers/lightnvm/pblk-read.c > +++ b/drivers/lightnvm/pblk-read.c > @@ -199,7 +199,7 @@ static void __pblk_end_io_read(struct pblk *pblk, struct nvm_rq *rqd, > struct bio *int_bio = rqd->bio; > unsigned long start_time = r_ctx->start_time; > > - generic_end_io_acct(dev->q, READ, &pblk->disk->part0, start_time); > + generic_end_io_acct(dev->q, REQ_OP_READ, &pblk->disk->part0, start_time); > > if (rqd->error) > pblk_log_read_err(pblk, rqd); > @@ -411,7 +411,8 @@ int pblk_submit_read(struct pblk *pblk, struct bio *bio) > return NVM_IO_ERR; > } > > - generic_start_io_acct(q, READ, bio_sectors(bio), &pblk->disk->part0); > + generic_start_io_acct(q, REQ_OP_READ, bio_sectors(bio), > + &pblk->disk->part0); > > bitmap_zero(&read_bitmap, nr_secs); > Looks good to me. Thanks.