lkml.org 
[lkml]   [2019]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v7 06/15] sched/core: uclamp: Reset uclamp values on RESET_ON_FORK
On Fri, Feb 08, 2019 at 10:05:45AM +0000, Patrick Bellasi wrote:
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 070caa1f72eb..8b282616e9c9 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -1071,7 +1071,7 @@ static void __setscheduler_uclamp(struct task_struct *p,
> }
> }
>
> -static void uclamp_fork(struct task_struct *p)
> +static void uclamp_fork(struct task_struct *p, bool reset)
> {
> unsigned int clamp_id;
>
> @@ -1080,6 +1080,17 @@ static void uclamp_fork(struct task_struct *p)

IIRC there's an early return here if the class doesn't have uclamp
support, which I think is wrong now. You want the reset irrespective of
whether the class supports it, no?

>
> for (clamp_id = 0; clamp_id < UCLAMP_CNT; ++clamp_id)
> p->uclamp[clamp_id].active = false;
> +
> + if (likely(!reset))
> + return;
> +
> + for (clamp_id = 0; clamp_id < UCLAMP_CNT; ++clamp_id) {
> + unsigned int clamp_value = uclamp_none(clamp_id);
> +
> + p->uclamp[clamp_id].user_defined = false;
> + p->uclamp[clamp_id].value = clamp_value;
> + p->uclamp[clamp_id].bucket_id = uclamp_bucket_id(clamp_value);
> + }
> }


\
 
 \ /
  Last update: 2019-03-13 21:53    [W:0.143 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site