Re: [PATCH] sched/core: Fix reset-on-fork from RT with uclamp
From: Joel Fernandes
Date: Tue Apr 14 2020 - 12:32:43 EST
On Tue, Apr 14, 2020 at 05:27:13PM +0100, Quentin Perret wrote:
> On Tuesday 14 Apr 2020 at 12:21:28 (-0400), Joel Fernandes wrote:
> > Shouldn't this be conditional on p->sched_reset_on_fork instead of deleting
> > the code?
>
> Right, it's not obvious from the diff, but this code _is_ conditional on
> p->sched_reset_on_fork already. This is what the whole function looks
> like with my patch applied:
>
> ---8<---
> static void uclamp_fork(struct task_struct *p)
> {
> enum uclamp_id clamp_id;
>
> for_each_clamp_id(clamp_id)
> p->uclamp[clamp_id].active = false;
>
> if (likely(!p->sched_reset_on_fork))
> return;
>
> for_each_clamp_id(clamp_id) {
> unsigned int clamp_value = uclamp_none(clamp_id);
>
> uclamp_se_set(&p->uclamp_req[clamp_id], clamp_value, false);
> }
Oh ok, thanks for clarification.
- Joel
> }
> --->8---
>
> Thanks,
> Quentin