Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PM: EM: Switch to rcu_dereference_all() in wakeup path

em_cpu_energy() is part of the EAS (Fair) task wakeup path. Now that
rcu_read_{,un}lock() have been removed from find_energy_efficient_cpu()
switch to rcu_dereference_all() and check for rcu_read_lock_any_held()
in em_cpu_energy() as well.
In EAS (Fair) task wakeup path is a preempt/IRQ disabled region, so
rcu_read_{,un}lock() can be removed.

Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://patch.msgid.link/5b1228b7-5949-4a45-9f62-e8ce936de694@arm.com

authored by

Dietmar Eggemann and committed by
Peter Zijlstra
8ca12326 f494bfb0

+2 -2
+2 -2
include/linux/energy_model.h
··· 248 248 struct em_perf_state *ps; 249 249 int i; 250 250 251 - WARN_ONCE(!rcu_read_lock_held(), "EM: rcu read lock needed\n"); 251 + lockdep_assert(rcu_read_lock_any_held()); 252 252 253 253 if (!sum_util) 254 254 return 0; ··· 267 267 * Find the lowest performance state of the Energy Model above the 268 268 * requested performance. 269 269 */ 270 - em_table = rcu_dereference(pd->em_table); 270 + em_table = rcu_dereference_all(pd->em_table); 271 271 i = em_pd_get_efficient_state(em_table->state, pd, max_util); 272 272 ps = &em_table->state[i]; 273 273