Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit cdacf701 authored by Qais Yousef's avatar Qais Yousef Committed by Lee Jones
Browse files

UPSTREAM: sched/uclamp: Fix locking around cpu_util_update_eff()



cpu_cgroup_css_online() calls cpu_util_update_eff() without holding the
uclamp_mutex or rcu_read_lock() like other call sites, which is
a mistake.

The uclamp_mutex is required to protect against concurrent reads and
writes that could update the cgroup hierarchy.

The rcu_read_lock() is required to traverse the cgroup data structures
in cpu_util_update_eff().

Surround the caller with the required locks and add some asserts to
better document the dependency in cpu_util_update_eff().

Bug: 254441685
Fixes: 7226017ad37a ("sched/uclamp: Fix a bug in propagating uclamp value in new cgroups")
Reported-by: default avatarQuentin Perret <qperret@google.com>
Signed-off-by: default avatarQais Yousef <qais.yousef@arm.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210510145032.1934078-3-qais.yousef@arm.com


(cherry picked from commit 93b73858701fd01de26a4a874eb95f9b7156fd4b)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: I6b11073f23f58ce4c2415cdfc46140a60e3411a2
parent 76142a99
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment