Re: [PATCH] cpufreq/schedutil: Only bind threads if needed
From: Christian Loehle
Date: Wed Sep 25 2024 - 05:37:07 EST
On 9/25/24 09:14, Juri Lelli wrote:
> Hi,
>
> On 12/09/24 17:01, Christian Loehle wrote:
>> On 9/12/24 16:41, Rafael J. Wysocki wrote:
>>> On Thu, Sep 12, 2024 at 3:53 PM Christian Loehle
>
> ...
>
>>>> diff --git a/kernel/sched/syscalls.c b/kernel/sched/syscalls.c
>>>> index c62acf509b74..7d4a4edfcfb9 100644
>>>> --- a/kernel/sched/syscalls.c
>>>> +++ b/kernel/sched/syscalls.c
>>>> @@ -1159,6 +1159,9 @@ int dl_task_check_affinity(struct task_struct *p, const struct cpumask *mask)
>>>> if (!task_has_dl_policy(p) || !dl_bandwidth_enabled())
>>>> return 0;
>>>>
>>>> + if (dl_entity_is_special(&p->dl))
>>>> + return 0;
>>>> +
>>>
>>> Care to explain this particular piece?
>>
>> Looks suspicious but the truncated comment below explains it:
>> /*
>> * Since bandwidth control happens on root_domain basis,
>> * if admission test is enabled, we only admit -deadline
>> * tasks allowed to run on all the CPUs in the task's
>> * root_domain.
>> */
>> So that would only allow setting it to all CPUs for the relevant
>> platforms unfortunately.
>>
>> That should be fine though since the sugov task is pretty much
>> a dummy in terms of bandwidth / admission control internally, so
>> no harm done to not enforce this when userspace wants to set
>> affinities.
>> ...Unless Juri disagrees.
>
> Nope, I agree. :)
>
> Wonder if we should put a comment along the lines of what you said above
> right above the new conditions (so that people will not need to wonder
> about it in the future). But not a strict requirement for me.
>
> Thanks! (and apologies for the delay in replying)
> Juri
Thank you Juri for taking a look. I agree with the comment, will
do a v2.
Regards,
Christian