Repository navigation
Commit 37481ad
sched/uclamp: Fix locking around cpu_util_update_eff()
[ Upstream commit 93b7385 ]
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().
Fixes: 7226017 ("sched/uclamp: Fix a bug in propagating uclamp value in new cgroups")
Reported-by: Quentin Perret <qperret@google.com>
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210510145032.1934078-3-qais.yousef@arm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 6c2b3d5 commit 37481ad
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7620 | 7620 | | |
7621 | 7621 | | |
7622 | 7622 | | |
| 7623 | + | |
| 7624 | + | |
7623 | 7625 | | |
| 7626 | + | |
| 7627 | + | |
7624 | 7628 | | |
7625 | 7629 | | |
7626 | 7630 | | |
| |||
7710 | 7714 | | |
7711 | 7715 | | |
7712 | 7716 | | |
| 7717 | + | |
| 7718 | + | |
| 7719 | + | |
7713 | 7720 | | |
7714 | 7721 | | |
7715 | 7722 | | |
| |||
0 commit comments