Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp1315589ybs; Mon, 25 May 2020 12:42:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoOmCsBbBUwvYZtUIJTdHikwg1JYkbuIIvSOIWUKHJKRpMHwUGt6N2EVngQYnPRptvR5yC X-Received: by 2002:a17:906:24cf:: with SMTP id f15mr20386645ejb.462.1590435761976; Mon, 25 May 2020 12:42:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590435761; cv=none; d=google.com; s=arc-20160816; b=BOCKHriFtarru/t3UffxKJw/NwG+pw65zkGajYz8HSjg65BbbJ0Jrv8lVZaTuKEJTH X9QUyRo7wpTVBsV1c/ey4qRD3E9YfuYHJkxMDU3HrpeJlvRRmC2R/CnwgsF/H6s7lpKc ptz6qtLL45ErRDilHD4QTP06pJXUYG2LB24LAdIZlB5V+vqvrWFOt7G4KdRXCoRVGaig CViTDflb0QYymTW1kkiRsScRX5DUfPdHIIYGaararqJsDfqfU63m2B5d6cv4mfeOheKw ArzteVcwfenGU6Wc4FEhUFzoJwTY5rnqzdXKLnaiFo9adiVt8QRV9gJYGJE4NBFcSQ6v HcAQ== 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:autocrypt:from:references:cc:to:subject; bh=2N/zhOrqVQdu0VK6A/ptST6U9/syPpdhGjL9y7A0b5c=; b=iKeyVzV8zvhLUOSmiNz7s7hZVcjMHf61XWscQGIu9lis8/ZRRCbG3SWlgw6qscQADr IaywJwtEMSq2MBjPMXVMaJHQw4CThovdiofUFUcsnncVhw2ubrs1MGJ1w/gUjGRbzl0R bYzFHIka8BkC7D73pH3i6GGCJESbQ6KXk91cHOOU6ac1/38r0C2yRHS2MYypRCY8zsIW tRPc7GTOelYADGKKqX4edCIdrlLp7/WSwH2FOiP4D1hdabFGOBPbRwC9pykpQjcyNuMN 3fBo9UMk/kYivPXkDkh0sDwXGRe9pSzvFpKMguo6lmHUA9KgT7UeTw2guTGeARZKtb8p Haqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sa22si359864ejb.157.2020.05.25.12.42.18; Mon, 25 May 2020 12:42:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390741AbgEYNDw (ORCPT + 99 others); Mon, 25 May 2020 09:03:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:34276 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388757AbgEYNDv (ORCPT ); Mon, 25 May 2020 09:03:51 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A5D8BABC2; Mon, 25 May 2020 13:03:52 +0000 (UTC) Subject: Re: [PATCH 05/16] bcache: use bio_{start,end}_io_acct To: Christoph Hellwig , Jens Axboe Cc: Konstantin Khlebnikov , Minchan Kim , Nitin Gupta , dm-devel@redhat.com, linux-block@vger.kernel.org, drbd-dev@lists.linbit.com, linux-bcache@vger.kernel.org, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org References: <20200525113014.345997-1-hch@lst.de> <20200525113014.345997-6-hch@lst.de> From: Coly Li Autocrypt: addr=colyli@suse.de; keydata= mQINBFYX6S8BEAC9VSamb2aiMTQREFXK4K/W7nGn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+g7XMDCMnPiDncQqgf96KR3cvw4wN8QrgA6xRo8xOc2C3X7jTMQUytCz9 0MyV1QARAQABiQI8BBgBCAAmAhsMFiEE6j5FL/T5SGCN6PrQxzkHk2t9+PwFAlxHziAFCRj7 5/EACgkQxzkHk2t9+PxgfA//cH5R1DvpJPwraTAl24SUcG9EWe+NXyqveApe05nk15zEuxxd e4zFEjo+xYZilSveLqYHrm/amvQhsQ6JLU+8N60DZHVcXbw1Eb8CEjM5oXdbcJpXh1/1BEwl 4phsQMkxOTns51bGDhTQkv4lsZKvNByB9NiiMkT43EOx14rjkhHw3rnqoI7ogu8OO7XWfKcL CbchjJ8t3c2XK1MUe056yPpNAT2XPNF2EEBPG2Y2F4vLgEbPv1EtpGUS1+JvmK3APxjXUl5z 6xrxCQDWM5AAtGfM/IswVjbZYSJYyH4BQKrShzMb0rWUjkpXvvjsjt8rEXpZEYJgX9jvCoxt oqjCKiVLpwje9WkEe9O9VxljmPvxAhVqJjX62S+TGp93iD+mvpCoHo3+CcvyRcilz+Ko8lfO hS9tYT0HDUiDLvpUyH1AR2xW9RGDevGfwGTpF0K6cLouqyZNdhlmNciX48tFUGjakRFsxRmX K0Jx4CEZubakJe+894sX6pvNFiI7qUUdB882i5GR3v9ijVPhaMr8oGuJ3kvwBIA8lvRBGVGn 9xvzkQ8Prpbqh30I4NMp8MjFdkwCN6znBKPHdjNTwE5PRZH0S9J0o67IEIvHfH0eAWAsgpTz +jwc7VKH7vkvgscUhq/v1/PEWCAqh9UHy7R/jiUxwzw/288OpgO+i+2l11Y= Message-ID: <85828157-ac53-57e8-1a27-068478ab5f5c@suse.de> Date: Mon, 25 May 2020 21:03:39 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200525113014.345997-6-hch@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/5/25 19:30, Christoph Hellwig wrote: > Switch bcache to use the nicer bio accounting helpers, and call the > routines where we also sample the start time to give coherent accounting > results. > > Signed-off-by: Christoph Hellwig Acked-by: Coly Li Coly Li > --- > drivers/md/bcache/request.c | 18 ++++-------------- > 1 file changed, 4 insertions(+), 14 deletions(-) > > diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c > index 77d1a26975174..22b483527176b 100644 > --- a/drivers/md/bcache/request.c > +++ b/drivers/md/bcache/request.c > @@ -668,9 +668,7 @@ static void backing_request_endio(struct bio *bio) > static void bio_complete(struct search *s) > { > if (s->orig_bio) { > - generic_end_io_acct(s->d->disk->queue, bio_op(s->orig_bio), > - &s->d->disk->part0, s->start_time); > - > + bio_end_io_acct(s->orig_bio, s->start_time); > trace_bcache_request_end(s->d, s->orig_bio); > s->orig_bio->bi_status = s->iop.status; > bio_endio(s->orig_bio); > @@ -730,7 +728,7 @@ static inline struct search *search_alloc(struct bio *bio, > s->recoverable = 1; > s->write = op_is_write(bio_op(bio)); > s->read_dirty_data = 0; > - s->start_time = jiffies; > + s->start_time = bio_start_io_acct(bio); > > s->iop.c = d->c; > s->iop.bio = NULL; > @@ -1082,8 +1080,7 @@ static void detached_dev_end_io(struct bio *bio) > bio->bi_end_io = ddip->bi_end_io; > bio->bi_private = ddip->bi_private; > > - generic_end_io_acct(ddip->d->disk->queue, bio_op(bio), > - &ddip->d->disk->part0, ddip->start_time); > + bio_end_io_acct(bio, ddip->start_time); > > if (bio->bi_status) { > struct cached_dev *dc = container_of(ddip->d, > @@ -1108,7 +1105,7 @@ static void detached_dev_do_request(struct bcache_device *d, struct bio *bio) > */ > ddip = kzalloc(sizeof(struct detached_dev_io_private), GFP_NOIO); > ddip->d = d; > - ddip->start_time = jiffies; > + ddip->start_time = bio_start_io_acct(bio); > ddip->bi_end_io = bio->bi_end_io; > ddip->bi_private = bio->bi_private; > bio->bi_end_io = detached_dev_end_io; > @@ -1190,11 +1187,6 @@ blk_qc_t cached_dev_make_request(struct request_queue *q, struct bio *bio) > } > } > > - generic_start_io_acct(q, > - bio_op(bio), > - bio_sectors(bio), > - &d->disk->part0); > - > bio_set_dev(bio, dc->bdev); > bio->bi_iter.bi_sector += dc->sb.data_offset; > > @@ -1311,8 +1303,6 @@ blk_qc_t flash_dev_make_request(struct request_queue *q, struct bio *bio) > return BLK_QC_T_NONE; > } > > - generic_start_io_acct(q, bio_op(bio), bio_sectors(bio), &d->disk->part0); > - > s = search_alloc(bio, d); > cl = &s->cl; > bio = &s->bio.bio; >