[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7531ba77-964a-169d-f55f-a8dcfcdbb450@huaweicloud.com>
Date: Sat, 13 Apr 2024 09:59:47 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: Tejun Heo <tj@...nel.org>, Yu Kuai <yukuai1@...weicloud.com>
Cc: axboe@...nel.dk, chenhuacai@...nel.org, josef@...icpanda.com,
jhs@...atatu.com, svenjoac@....de, raven@...maw.net, pctammela@...atatu.com,
qde@...cy.de, zhaotianrui@...ngson.cn, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, loongarch@...ts.linux.dev,
cgroups@...r.kernel.org, yi.zhang@...wei.com, yangerkun@...wei.com,
"yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH RFC v2 2/6] blk-throttle: delay initialization until
configuration
Hi,
在 2024/04/13 1:59, Tejun Heo 写道:
> Hello,
>
> On Sat, Apr 06, 2024 at 04:00:55PM +0800, Yu Kuai wrote:
>> @@ -1480,6 +1547,9 @@ void blk_throtl_cancel_bios(struct gendisk *disk)
>> struct cgroup_subsys_state *pos_css;
>> struct blkcg_gq *blkg;
>>
>> + if (!q->td)
>> + return;
>
> So, this naked test is safe because the interface functions are shut down by
> the time this function is called.
>
>> static inline bool blk_should_throtl(struct bio *bio)
>> {
>> - struct throtl_grp *tg = blkg_to_tg(bio->bi_blkg);
>> + struct throtl_grp *tg;
>> int rw = bio_data_dir(bio);
>>
>> + if (!bio->bi_bdev->bd_queue->td)
>> + return false;
>
> and this one because ->td is set while the queue is frozen and this path
> shouldn't be running while it gets set, right?
Yes, this is called under bio_queue_enter()
>
> Can you please add comments explaining why those are safe? Otherwise, the
> patch looks generally sane to me on the first glance. Can you please also
> add how you tested the change?
And I realized that there are no tests for bkl-throttle from blktests,
and I'm using some other tests from our testers to cover basic
functionality. Perhaps will it make sense to add some tests to blktests?
Thanks,
Kuai
>
> Thanks.
>
Powered by blists - more mailing lists