Re: [PATCH] iocost: treat as root level when parents are activated

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

 



Hello, Jiufei.

On Mon, Nov 11, 2019 at 03:37:18PM +0800, Jiufei Xue wrote:
> Internal nodes that issued IOs are treated as root when leaves are
> activated. However, leaf nodes can still be activated when internal
> nodes are active, leaving the sum of hweights exceeds HWEIGHT_WHOLE.
> 
> I think we should also treat the leaf nodes as root while leaf-only
> constraint broken.

Hmm... I'm not sure this description makes sense.

> @@ -1057,8 +1057,8 @@ static bool iocg_activate(struct ioc_gq *iocg, struct ioc_now *now)
>  	atomic64_set(&iocg->active_period, cur_period);
>  
>  	/* already activated or breaking leaf-only constraint? */
> -	for (i = iocg->level; i > 0; i--)
> -		if (!list_empty(&iocg->active_list))
> +	for (i = iocg->level - 1; i > 0; i--)
> +		if (!list_empty(&iocg->ancestors[i]->active_list))

But there's an obvious bug there as it's checking the same active_list
over and over again.  Shouldn't it be sth like the following instead?

	if (!list_empty(&iocg->active_list))
		goto succeed_unlock;
	for (i = iocg->level - 1; i > 0; i--)
		if (!list_empty(&iocg->ancestors[i]->active_list))
			goto fail_unlock;

Thanks.

-- 
tejun



[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