lkml.org 
[lkml]   [2019]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v6 09/16] sched/cpufreq: uclamp: Add utilization clamping for RT tasks
On Tue, Jan 15, 2019 at 10:15:06AM +0000, Patrick Bellasi wrote:
> @@ -858,16 +859,23 @@ static inline void
> uclamp_effective_get(struct task_struct *p, unsigned int clamp_id,
> unsigned int *clamp_value, unsigned int *bucket_id)
> {
> + struct uclamp_se *default_clamp;
> +
> /* Task specific clamp value */
> *clamp_value = p->uclamp[clamp_id].value;
> *bucket_id = p->uclamp[clamp_id].bucket_id;
>
> + /* RT tasks have different default values */
> + default_clamp = task_has_rt_policy(p)
> + ? uclamp_default_perf
> + : uclamp_default;
> +
> /* System default restriction */
> - if (unlikely(*clamp_value < uclamp_default[UCLAMP_MIN].value ||
> - *clamp_value > uclamp_default[UCLAMP_MAX].value)) {
> + if (unlikely(*clamp_value < default_clamp[UCLAMP_MIN].value ||
> + *clamp_value > default_clamp[UCLAMP_MAX].value)) {
> /* Keep it simple: unconditionally enforce system defaults */
> - *clamp_value = uclamp_default[clamp_id].value;
> - *bucket_id = uclamp_default[clamp_id].bucket_id;
> + *clamp_value = default_clamp[clamp_id].value;
> + *bucket_id = default_clamp[clamp_id].bucket_id;
> }
> }

So I still don't much like the whole effective thing; but I think you
should use rt_task() instead of task_has_rt_policy().

\
 
 \ /
  Last update: 2019-01-23 11:53    [W:0.505 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site