Re: [PATCH] blk-throttle: check policy bit in blk_throtl_activated()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux