lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6f6172df-7953-078e-1310-eccf0ca4f47b@huaweicloud.com>
Date:   Tue, 14 Mar 2023 09:16:36 +0800
From:   Yu Kuai <yukuai1@...weicloud.com>
To:     Song Liu <song@...nel.org>, Yu Kuai <yukuai1@...weicloud.com>
Cc:     guoqing.jiang@...ux.dev, jgq516@...il.com, neilb@...e.de,
        shli@...com, lzhong@...e.com, linux-raid@...r.kernel.org,
        linux-kernel@...r.kernel.org, yi.zhang@...wei.com,
        yangerkun@...wei.com, "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH v2 1/6] md/raid10: don't call bio_start_io_acct twice for
 bio which experienced read error

Hi,

在 2023/03/14 6:08, Song Liu 写道:
> On Thu, Mar 9, 2023 at 11:39 PM Yu Kuai <yukuai1@...weicloud.com> wrote:
>>
>> From: Yu Kuai <yukuai3@...wei.com>
>>
>> handle_read_error() will resumit r10_bio by raid10_read_request(), which
>> will call bio_start_io_acct() again, while bio_end_io_acct() will only
>> be called once.
>>
>> Fix the problem by don't account io again from handle_read_error().
>>
>> Fixes: 528bc2cf2fcc ("md/raid10: enable io accounting")
>> Signed-off-by: Yu Kuai <yukuai3@...wei.com>
>> Acked-by: Guoqing Jiang <guoqing.jiang@...ux.dev>
> 
> I would rather keep same argument lists for raid10_read_request
> and raid10_write_request. How about we do something like this
> instead?
> 
> diff --git i/drivers/md/raid10.c w/drivers/md/raid10.c
> index 6b39e6c7ada3..13f33a8a8fe8 100644
> --- i/drivers/md/raid10.c
> +++ w/drivers/md/raid10.c
> @@ -1248,7 +1248,8 @@ static void raid10_read_request(struct mddev
> *mddev, struct bio *bio,
>          }
>          slot = r10_bio->read_slot;
> 
> -       if (blk_queue_io_stat(bio->bi_bdev->bd_disk->queue))
> +       if (!r10_bio->start_time &&
> +           blk_queue_io_stat(bio->bi_bdev->bd_disk->queue))
>                  r10_bio->start_time = bio_start_io_acct(bio);
>          read_bio = bio_alloc_clone(rdev->bdev, bio, gfp, &mddev->bio_set);
> 
> @@ -1578,6 +1579,7 @@ static void __make_request(struct mddev *mddev,
> struct bio *bio, int sectors)
>          r10_bio->sector = bio->bi_iter.bi_sector;
>          r10_bio->state = 0;
>          r10_bio->read_slot = -1;
> +       r10_bio->start_time = 0;
>          memset(r10_bio->devs, 0, sizeof(r10_bio->devs[0]) *
>                          conf->geo.raid_disks);
> 
> Thanks,
> Song

Of course, this looks better. I'll send a new verison for this patch.

Thanks,
Kuai

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ