lkml.org 
[lkml]   [2020]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 6/6] sched/rt: Remove unnecessary assignment in inc/dec_rt_migration
From
Date
On 24.02.20 12:31, Qais Yousef wrote:
> On 02/24/20 00:16, Dietmar Eggemann wrote:
>> On 23.02.20 19:40, Qais Yousef wrote:

[...]

>>> - rt_rq = &rq_of_rt_rq(rt_rq)->rt;
>>
>> IMHO, this is here to get the root rt_rq from any rt_rq (task_groups).
>> Looks like that e.g rt_nr_total is only maintained on root rt_rq's.
>>
>> Similar to CFS' &rq_of(cfs_rq)->cfs (cfs_rq_util_change()) to get root
>> cfs_rq.
>>
>> Not sure where CONFIG_RT_GROUP_SCHED=y is used but it's part of the rt
>> class implementation.
>
> Ah I see. That was obvious.. How about the below comment?
>
> This code is executed only if rt_entity_is_task(), I don't think this grantees
> that the rt_rq isn't for a group?

No, an rt task can run in this taskgroup (e.g. "/tg/tg1"), i.e. in
tg1->rt_rq[cpu].

The taskgroup skeleton rt_se of e.g. "/tg/tg1/tg11" would also run in
tg1->rt_rq[cpu] but for those rt_se's we bail out of [inc/dec]_rt_migration.

>
> I need to go and unravel the layers maybe.
>
> Thanks!
>
> --
> Qais Yousef
>
> -->8--
>
> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> index b35e49cdafcc..f929867215c4 100644
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -343,6 +343,8 @@ static void inc_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
> return;
>
> p = rt_task_of(rt_se);
> +
> + /* get the root rt_rq if this is the rt_rq of a group */

Not sure if a comment like this will help since:

(a) the definition of rq_of_rt_rq() for the !CONFIG_RT_GROUP_SCHED case

(b) rt_rq might already be the root rt_rq in case the task runs in "/"

[...]

\
 
 \ /
  Last update: 2020-02-24 14:05    [W:0.064 / U:6.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site