Skip to contentSkip to conversation

Why is there a restriction on the policy->rwsem & CPUFREQ_GOV_POLICY_EXIT ?

Question Prarit Bhargava 2 participants 2 messages Jul 23, 2014 – Jul 24, 2014

lore
Share & tools
lore
#0 lore raw

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.

#1 lore raw
Quoted 8 lines · Prarit Bhargava

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);

Quoted 5 lines

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()?

955ef48 cpufreq: Drop rwsem lock around CPUFREQ_GOV_POLICY_EXIT