diff options
author | Dietmar Eggemann <dietmar.eggemann@arm.com> | 2020-11-13 14:34:54 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2020-11-19 13:25:47 +0300 |
commit | 480a6ca2dc6ed82c783faf7e4a9644769b8397d8 (patch) | |
tree | b8aeff5c9857ad96c731c1d7b268aa408bdbcee6 /kernel/sched/topology.c | |
parent | b19a888c1e9bdf12e0d8dd9aeb887ca7de91c8a5 (diff) | |
download | linux-480a6ca2dc6ed82c783faf7e4a9644769b8397d8.tar.xz |
sched/uclamp: Allow to reset a task uclamp constraint value
In case the user wants to stop controlling a uclamp constraint value
for a task, use the magic value -1 in sched_util_{min,max} with the
appropriate sched_flags (SCHED_FLAG_UTIL_CLAMP_{MIN,MAX}) to indicate
the reset.
The advantage over the 'additional flag' approach (i.e. introducing
SCHED_FLAG_UTIL_CLAMP_RESET) is that no additional flag has to be
exported via uapi. This avoids the need to document how this new flag
has be used in conjunction with the existing uclamp related flags.
The following subtle issue is fixed as well. When a uclamp constraint
value is set on a !user_defined uclamp_se it is currently first reset
and then set.
Fix this by AND'ing !user_defined with !SCHED_FLAG_UTIL_CLAMP which
stands for the 'sched class change' case.
The related condition 'if (uc_se->user_defined)' moved from
__setscheduler_uclamp() into uclamp_reset().
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Yun Hsiang <hsiang023167@gmail.com>
Link: https://lkml.kernel.org/r/20201113113454.25868-1-dietmar.eggemann@arm.com
Diffstat (limited to 'kernel/sched/topology.c')
0 files changed, 0 insertions, 0 deletions