Why is there a restriction on the policy->rwsem & CPUFREQ_GOV_POLICY_EXIT ?
I'm debugging a race/locking issue in the store_scaling_governor path and came across the following restriction on using a semaphore in the cpufreq_policy struct defined in include/linux/cpufreq.h :
* Additional rules:
* - Lock should not be held across
* __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
struct rw_semaphore rwsem;
I'm not completely familiar with this code and am wondering why the restriction is in place? Is there a worry about the module_put() in __cpufreq_governor()?
Thanks,
P.
Quoted 8 lines · Prarit Bhargava
I'm debugging a race/locking issue in the
store_scaling_governorpath and came across the following restriction on using a semaphore in thecpufreq_policystruct defined ininclude/linux/cpufreq.h:* Additional rules:
* - Lock should not be held across
*__cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
Quoted 5 lines
struct
rw_semaphorerwsem;I'm not completely familiar with this code and am wondering why the restriction is in place? Is there a worry about the
module_put()in__cpufreq_governor()?
955ef48 cpufreq: Drop rwsem lock around CPUFREQ_GOV_POLICY_EXIT