Re: [RFC PATCH v1] sched/uclamp: Introduce SCHED_FLAG_RESET_UCLAMP_ON_FORK flag

From: Dietmar Eggemann
Date: Wed Apr 19 2023 - 01:19:14 EST


On 16/04/2023 23:34, David Dai wrote:
> A userspace service may manage uclamp dynamically for individual tasks and
> a child task will unintentionally inherit a pesudo-random uclamp setting.
> This could result in the child task being stuck with a static uclamp value

Could you explain this with a little bit more detail? Why isn't the
child task also managed by the userspace service?

The child task will only make a difference if it's on the rq.

Does this issue happen with uclamp mainline or only with Android's
slightly different version (max- vs. sum aggregation)?

> that results in poor performance or poor power.
>
> Using SCHED_FLAG_RESET_ON_FORK is too coarse for this usecase and will
> reset other useful scheduler attributes. Adding a
> SCHED_FLAG_RESET_UCLAMP_ON_FORK will allow userspace to have finer control
> over scheduler attributes of child processes.

[...]