public inbox for linux-raid@vger.kernel.org
 help / color / mirror / Atom feed
From: Guoqing Jiang <jgq516@gmail.com>
To: Song Liu <song@kernel.org>
Cc: linux-raid <linux-raid@vger.kernel.org>,
	Artur Paszkiewicz <artur.paszkiewicz@intel.com>,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH V3 2/8] md: add io accounting for raid0 and raid5
Date: Thu, 27 May 2021 10:00:06 +0800	[thread overview]
Message-ID: <20118145-e993-b11f-8907-5e2f1cc44ddb@gmail.com> (raw)
In-Reply-To: <CAPhsuW7Xz6nOPFsn64qLhvDtNGDGX6Pf_U3Tb=d0KiL4+9_h=Q@mail.gmail.com>



On 5/27/21 12:00 AM, Song Liu wrote:
> On Wed, May 26, 2021 at 12:53 AM Guoqing Jiang <jgq516@gmail.com> wrote:
>>
>>
>> On 5/26/21 2:32 PM, Song Liu wrote:
>>> On Tue, May 25, 2021 at 2:47 AM Guoqing Jiang <jgq516@gmail.com> wrote:
>>>
>>>
>>>> --- a/drivers/md/md.c
>>>> +++ b/drivers/md/md.c
>>>> @@ -2340,7 +2340,8 @@ int md_integrity_register(struct mddev *mddev)
>>>>                                  bdev_get_integrity(reference->bdev));
>>>>
>>>>           pr_debug("md: data integrity enabled on %s\n", mdname(mddev));
>>>> -       if (bioset_integrity_create(&mddev->bio_set, BIO_POOL_SIZE)) {
>>>> +       if (bioset_integrity_create(&mddev->bio_set, BIO_POOL_SIZE) ||
>>>> +           bioset_integrity_create(&mddev->io_acct_set, BIO_POOL_SIZE)) {
>>> Added better error handling here.
>> No need to do it here, because md_integrity_register is called from
>> md_run() -> pers->run(), if above returns failure, then the path
>> (bioset_exit -> bioset_integrity_free) is triggered.
>>
>> I thought we probably need a comment here given it is not explicit.
> I think it is better to handle it within this function. Does it have
> any downside
> to call bioset_integrity_free(&mddev->bio_set) here?
>
> [...]

md_run has to deal with failure path by call bioset_exit, which
already call bioset_integrity_free implicitly. Why the additional
call of bioset_integrity_free would be helpful? Or do you want
to remove bioset_exit from md_run as well?

>>>> +
>>>> +       if (!blk_queue_io_stat((*bio)->bi_bdev->bd_disk->queue))
>>>> +               return;
>>> Added blk_queue_flag_set(QUEUE_FLAG_IO_STAT, mddev->queue); to md_run.
>>> We still need it as md doesn't use mq. Without it, the default iostats is 0.
>>>
>> It enables io accounting by default, so raid5 and raid0 users have to
>> disable it if they don't want the additional latency.
> iostats was on by default before this set, as we didn't check
> blk_queue_io_stat().
> So it is better to keep the same behavior.

Could you point the place where md enables iostats before the set?
I can't find relevant code for it.

Thanks,
Guoqing

  reply	other threads:[~2021-05-27  2:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25  9:46 [PATCH V3 0/6] md: io stats accounting Guoqing Jiang
2021-05-25  9:46 ` [PATCH V3 1/8] md: revert " Guoqing Jiang
2021-05-25  9:46 ` [PATCH V3 2/8] md: add io accounting for raid0 and raid5 Guoqing Jiang
2021-05-26  6:32   ` Song Liu
2021-05-26  7:53     ` Guoqing Jiang
2021-05-26 16:00       ` Song Liu
2021-05-27  2:00         ` Guoqing Jiang [this message]
2021-05-27  6:14           ` Song Liu
2021-05-27  6:33             ` Guoqing Jiang
2021-05-27 15:25   ` Christoph Hellwig
2021-05-28  9:20     ` Guoqing Jiang
2021-05-25  9:46 ` [PATCH V3 3/8] md/raid5: move checking badblock before clone bio in raid5_read_one_chunk Guoqing Jiang
2021-05-25  9:46 ` [PATCH V3 4/8] md/raid5: avoid redundant bio clone " Guoqing Jiang
2021-05-25  9:46 ` [PATCH V3 5/8] md/raid1: rename print_msg with r1bio_existed Guoqing Jiang
2021-05-25  9:46 ` [PATCH V3 6/8] md/raid1: enable io accounting Guoqing Jiang
2021-05-25  9:46 ` [PATCH V3 7/8] md/raid10: " Guoqing Jiang
2021-05-25  9:46 ` [PATCH V3 8/8] md: mark some personalities as deprecated Guoqing Jiang
2021-06-01  1:19 ` [Update PATCH V3 2/8] md: add io accounting for raid0 and raid5 Guoqing Jiang
2021-06-03  1:17   ` Guoqing Jiang
2021-06-03  6:54     ` Song Liu

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=20118145-e993-b11f-8907-5e2f1cc44ddb@gmail.com \
    --to=jgq516@gmail.com \
    --cc=artur.paszkiewicz@intel.com \
    --cc=hch@infradead.org \
    --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