Skip to content

Commit 6e1ff07

Browse files
Qais YousefIngo Molnar
authored andcommitted
sched/uclamp: Fix incorrect condition
uclamp_update_active() should perform the update when p->uclamp[clamp_id].active is true. But when the logic was inverted in [1], the if condition wasn't inverted correctly too. [1] https://lore.kernel.org/lkml/[email protected]/ Reported-by: Suren Baghdasaryan <[email protected]> Signed-off-by: Qais Yousef <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Vincent Guittot <[email protected]> Cc: Ben Segall <[email protected]> Cc: Dietmar Eggemann <[email protected]> Cc: Juri Lelli <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Patrick Bellasi <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Thomas Gleixner <[email protected]> Fixes: babbe17 ("sched/uclamp: Update CPU's refcount on TG's clamp changes") Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent b90f7c9 commit 6e1ff07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ uclamp_update_active(struct task_struct *p, enum uclamp_id clamp_id)
10651065
* affecting a valid clamp bucket, the next time it's enqueued,
10661066
* it will already see the updated clamp bucket value.
10671067
*/
1068-
if (!p->uclamp[clamp_id].active) {
1068+
if (p->uclamp[clamp_id].active) {
10691069
uclamp_rq_dec_id(rq, p, clamp_id);
10701070
uclamp_rq_inc_id(rq, p, clamp_id);
10711071
}

0 commit comments

Comments
 (0)