mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 03:27:03 +02:00
kernel/sched/walt: rd->pd not getting updated soon enough
If the energy model is not updated by the time rebalance_domains is called for the first time, the root domain -> perf_domain values will get erased completely, and will be invalid. The responsibility for this race is outside of the walt module. walt_find_energy_efficient_cpu() relies upon rd->pd being valid and cannot function properly without it. This is critical to proper walt functionality and it cannot move forward without it. Decisvely catch the failure. Change-Id: Iee8030afd487dcee1d9cc18c2d655ecc26938279 Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
This commit is contained in:
parent
427c7e27f6
commit
5ca19b7ae1
|
|
@ -4559,6 +4559,7 @@ static void walt_init(struct work_struct *work)
|
|||
{
|
||||
struct ctl_table_header *hdr;
|
||||
static atomic_t already_inited = ATOMIC_INIT(0);
|
||||
struct root_domain *rd = cpu_rq(cpumask_first(cpu_active_mask))->rd;
|
||||
int i;
|
||||
|
||||
might_sleep();
|
||||
|
|
@ -4600,6 +4601,11 @@ static void walt_init(struct work_struct *work)
|
|||
}
|
||||
|
||||
topology_clear_scale_freq_source(SCALE_FREQ_SOURCE_ARCH, cpu_online_mask);
|
||||
|
||||
if (!rcu_dereference(rd->pd))
|
||||
WALT_BUG(WALT_BUG_WALT, NULL,
|
||||
"root domain's perf-domain values not initialized rd->pd=%d.",
|
||||
rd->pd);
|
||||
}
|
||||
|
||||
static DECLARE_WORK(walt_init_work, walt_init);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user