From: Jiufei Xue <jiufei.xue@linux.alibaba.com>
To: Tejun Heo <tj@kernel.org>
Cc: axboe@kernel.dk, cgroups@vger.kernel.org,
linux-block@vger.kernel.org, joseph.qi@linux.alibaba.com
Subject: Re: [PATCH] iocost: treat as root level when parents are activated
Date: Tue, 12 Nov 2019 09:38:57 +0800 [thread overview]
Message-ID: <7be6fb71-7e08-e369-cbbe-678129cc62ff@linux.alibaba.com> (raw)
In-Reply-To: <20191111162538.GB4163745@devbig004.ftw2.facebook.com>
Hi Tejun,
On 2019/11/12 上午12:25, Tejun Heo wrote:
> 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.
>
Should I change the description to something like this?
"we should treat the leaf nodes as root while the parent are already activated".
>> @@ -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;
iocg has already checked before, do you mean we should check it again
after ioc->lock?
> for (i = iocg->level - 1; i > 0; i--)
> if (!list_empty(&iocg->ancestors[i]->active_list))
> goto fail_unlock;
>
> Thanks.
>
Thanks,
Jiufei
next prev parent reply other threads:[~2019-11-12 1:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-11 7:37 [PATCH] iocost: treat as root level when parents are activated Jiufei Xue
2019-11-11 16:25 ` Tejun Heo
2019-11-12 1:38 ` Jiufei Xue [this message]
2019-11-12 15:31 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7be6fb71-7e08-e369-cbbe-678129cc62ff@linux.alibaba.com \
--to=jiufei.xue@linux.alibaba.com \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=joseph.qi@linux.alibaba.com \
--cc=linux-block@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.