public inbox for linux-raid@vger.kernel.org
 help / color / mirror / Atom feed
From: Guoqing Jiang <jgq516@gmail.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: song@kernel.org, linux-raid@vger.kernel.org,
	artur.paszkiewicz@intel.com,
	Guoqing Jiang <jiangguoqing@kylinos.cn>
Subject: Re: [PATCH 4/5] md/raid1: enable io accounting
Date: Wed, 19 May 2021 09:47:23 +0800	[thread overview]
Message-ID: <1b18eae2-944e-2779-96b8-8081ffd707a7@gmail.com> (raw)
In-Reply-To: <YKPD4IxoGecsvQyv@infradead.org>



On 5/18/21 9:40 PM, Christoph Hellwig wrote:
> On Tue, May 18, 2021 at 01:32:24PM +0800, Guoqing Jiang wrote:
>> For raid1, we record the start time between split bio and clone bio,
>> and finish the accounting in the final endio.
>>
>> Also introduce start_time in r1bio accordingly.
>>
>> Signed-off-by: Guoqing Jiang <jiangguoqing@kylinos.cn>
>> ---
>>   drivers/md/raid1.c | 11 +++++++++++
>>   drivers/md/raid1.h |  1 +
>>   2 files changed, 12 insertions(+)
>>
>> diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
>> index ced076ba560e..b08a47523dbb 100644
>> --- a/drivers/md/raid1.c
>> +++ b/drivers/md/raid1.c
>> @@ -300,6 +300,8 @@ static void call_bio_endio(struct r1bio *r1_bio)
>>   	if (!test_bit(R1BIO_Uptodate, &r1_bio->state))
>>   		bio->bi_status = BLK_STS_IOERR;
>>   
>> +	if (blk_queue_io_stat(bio->bi_bdev->bd_disk->queue))
>> +		bio_end_io_acct_remapped(bio, r1_bio->start_time, bio->bi_bdev);
> This can use bio_end_io_acct.

Sure.

>> +	/*
>> +	 * Reuse print_msg, if it is false then a fresh r1_bio is just
>> +	 * allocated before.
>> +	 */
>> +	if (!print_msg && blk_queue_io_stat(bio->bi_bdev->bd_disk->queue))
>> +		r1_bio->start_time = bio_start_io_acct(bio);
>> +
> Please rename the print_msg vaiable to something sensible and drop the
> comment.

Ok.

Thanks,
Guoqing

  reply	other threads:[~2021-05-19  1:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18  5:32 [PATCH 0/5] md: io stats accounting Guoqing Jiang
2021-05-18  5:32 ` [PATCH 1/5] md: revert " Guoqing Jiang
2021-05-18  5:32 ` [PATCH 2/5] md: the latest try for improve " Guoqing Jiang
2021-05-18 10:12   ` Artur Paszkiewicz
2021-05-19  1:30     ` Guoqing Jiang
2021-05-19  7:26       ` Artur Paszkiewicz
2021-05-19  7:46         ` Christoph Hellwig
2021-05-19  8:09         ` Guoqing Jiang
2021-05-20  0:45           ` Song Liu
2021-05-18 13:35   ` Christoph Hellwig
2021-05-19  1:40     ` Guoqing Jiang
2021-05-18  5:32 ` [PATCH 3/5] md-multipath: enable io accounting Guoqing Jiang
2021-05-18 13:37   ` Christoph Hellwig
2021-05-19  1:46     ` Guoqing Jiang
2021-05-18  5:32 ` [PATCH 4/5] md/raid1: " Guoqing Jiang
2021-05-18 13:40   ` Christoph Hellwig
2021-05-19  1:47     ` Guoqing Jiang [this message]
2021-05-18  5:32 ` [PATCH 5/5] md/raid10: " Guoqing Jiang
2021-05-19  0:14 ` [PATCH 0/5] md: io stats accounting Song Liu
2021-05-19  1:50   ` Guoqing Jiang

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=1b18eae2-944e-2779-96b8-8081ffd707a7@gmail.com \
    --to=jgq516@gmail.com \
    --cc=artur.paszkiewicz@intel.com \
    --cc=hch@infradead.org \
    --cc=jiangguoqing@kylinos.cn \
    --cc=linux-raid@vger.kernel.org \
    --cc=song@kernel.org \
    /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