lkml.org 
[lkml]   [2019]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 3/4] sched/fair: Make task_fits_capacity() consider uclamp restrictions
From
Date
On 10/12/2019 17:07, Dietmar Eggemann wrote:
> On 03/12/2019 16:59, Valentin Schneider wrote:
>
> [...]
>
>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>> index 08a233e97a01..dc3e86cb2b2e 100644
>> --- a/kernel/sched/fair.c
>> +++ b/kernel/sched/fair.c
>> @@ -3711,6 +3711,22 @@ static inline unsigned long task_util_est(struct task_struct *p)
>> return max(task_util(p), _task_util_est(p));
>> }
>>
>> +#ifdef CONFIG_UCLAMP_TASK
>> +static inline
>> +unsigned long uclamp_task_util(struct task_struct *p)
>> +{
>> + return clamp(task_util_est(p),
>> + (unsigned long)uclamp_eff_value(p, UCLAMP_MIN),
>> + (unsigned long)uclamp_eff_value(p, UCLAMP_MAX));
>> +}
>> +#else
>> +static inline
>> +unsigned long uclamp_task_util(struct task_struct *p)
>
> [...]
>
> Save some lines?
>

Right! I went a bit overboard there.

> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
<snip>

\
 
 \ /
  Last update: 2019-12-10 18:10    [W:4.688 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site