[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_4D98FA22B5856469AC62088A7AC6D67CB009@qq.com>
Date: Thu, 4 Sep 2025 18:05:16 +0800
From: Han Guangjiang <gj.han@...mail.com>
To: yukuai1@...weicloud.com
Cc: axboe@...nel.dk,
fanggeng@...iang.com,
gj.han@...mail.com,
hanguangjiang@...iang.com,
liangjie@...iang.com,
linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org,
yangchen11@...iang.com,
yukuai3@...wei.com
Subject: Re: [PATCH] blk-throttle: check policy bit in blk_throtl_activated()
Hi,
>> static inline bool blk_throtl_activated(struct request_queue *q)
>> {
>> - return q->td != NULL;
>> + return q->td != NULL && test_bit(blkcg_policy_throtl.plid, q->blkcg_pols);
>> }
>
> You can just remove the fist checking, p->td must be set if policy is
> enabled. And please make blkcg_policy_enabled() inline function in
> blk-cgroup.h and use it here.
We intentionally kept the q->td != NULL check because we cannot guarantee
that the policy module is fully loaded when this function is called.
If the policy module is not loaded yet, blkcg_policy_throtl.plid might not be
assigned, which could cause the test_bit() check to be incorrect.
By keeping this check, we ensure that we have at least reached the cgroup
configuration flow, indicating that the policy loading is complete.
I'm wondering if there are any risks here and whether we should remove
the q->td != NULL check?
Thanks,
Han Guangjiang
Powered by blists - more mailing lists