[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <661CB1A2-5BAC-439D-BCE2-64F9A0CD280E@linaro.org>
Date: Tue, 17 Apr 2018 14:32:39 +0200
From: Paolo Valente <paolo.valente@...aro.org>
To: Jiang Biao <jiang.biao2@....com.cn>
Cc: Jens Axboe <axboe@...nel.dk>,
linux-block <linux-block@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Tejun Heo <tj@...nel.org>, zhong.weidong@....com.cn,
wen.yang99@....com.cn, Ulf Hansson <ulf.hansson@...aro.org>,
Linus Walleij <linus.walleij@...aro.org>,
Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH] blkcg: not hold blkcg lock when deactivating policy.
> Il giorno 17 apr 2018, alle ore 09:10, Jiang Biao <jiang.biao2@....com.cn> ha scritto:
>
> As described in the comment of blkcg_activate_policy(),
> *Update of each blkg is protected by both queue and blkcg locks so
> that holding either lock and testing blkcg_policy_enabled() is
> always enough for dereferencing policy data.*
> with queue lock held, there is no need to hold blkcg lock in
> blkcg_deactivate_policy(). Similar case is in
> blkcg_activate_policy(), which has removed holding of blkcg lock in
> commit 4c55f4f9ad3001ac1fefdd8d8ca7641d18558e23.
>
Hi,
by chance, did you check whether this may cause problems with bfq,
being the latter not protected by the queue lock as cfq?
Thanks,
Paolo
> Signed-off-by: Jiang Biao <jiang.biao2@....com.cn>
> Signed-off-by: Wen Yang <wen.yang99@....com.cn>
> CC: Tejun Heo <tj@...nel.org>
> CC: Jens Axboe <axboe@...nel.dk>
> ---
> block/blk-cgroup.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
> index c2033a2..2b7f8d0 100644
> --- a/block/blk-cgroup.c
> +++ b/block/blk-cgroup.c
> @@ -1367,17 +1367,12 @@ void blkcg_deactivate_policy(struct request_queue *q,
> __clear_bit(pol->plid, q->blkcg_pols);
>
> list_for_each_entry(blkg, &q->blkg_list, q_node) {
> - /* grab blkcg lock too while removing @pd from @blkg */
> - spin_lock(&blkg->blkcg->lock);
> -
> if (blkg->pd[pol->plid]) {
> if (pol->pd_offline_fn)
> pol->pd_offline_fn(blkg->pd[pol->plid]);
> pol->pd_free_fn(blkg->pd[pol->plid]);
> blkg->pd[pol->plid] = NULL;
> }
> -
> - spin_unlock(&blkg->blkcg->lock);
> }
>
> spin_unlock_irq(q->queue_lock);
> --
> 2.7.4
>
Powered by blists - more mailing lists