[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c8a16fe9-4ad2-682d-0d34-1049dc217d62@huawei.com>
Date: Sat, 4 Dec 2021 16:03:53 +0800
From: "yukuai (C)" <yukuai3@...wei.com>
To: Michal Koutný <mkoutny@...e.com>
CC: <hch@...radead.org>, <tj@...nel.org>, <axboe@...nel.dk>,
<cgroups@...r.kernel.org>, <linux-block@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <yi.zhang@...wei.com>
Subject: Re: [PATCH v4 2/2] block: cancel all throttled bios in del_gendisk()
在 2021/12/03 18:27, Michal Koutný 写道:
> On Fri, Dec 03, 2021 at 03:50:01PM +0800, "yukuai (C)" <yukuai3@...wei.com> wrote:
>> blkg_destroy() is protected by the queue_lock,so I think queue_lock can
>> protect such concurrent scenario.
>
> blkg_destroy() is not as destroying :-) as actual free, you should
> synchronize against (the queue_lock ensures this for
> pd_free_fn=throtl_pd_free but you may still trip on blkcg after
> blkcg_css_free()).
Hi, Michal
I was thinking that if there are active blkgs, holding queue_lock will
ensure blkcg won't be freed. However, if there are no active blkgs in
the first place, it seems right rcu_read_lock() can prevent this
iteration concurrent with css_release->css_release_work_fn->
css_free_rwork_fn.
By the way, does spin_lock can guarantee this since it disables preempt
like what rcu_read_lock() does?
Thanks,
Kuai
>
> [Actually, I think you should see a warning in your situation if you
> enable CONFIG_PROVE_RCU.]
>
> HTH,
> Michal
>
Powered by blists - more mailing lists