[CPUFREQ] Rewrite lock in cpufreq to eliminate cpufreq/hotplug related issues
Yet another attempt to resolve cpufreq and hotplug locking issues. Patchset has 3 patches: * Rewrite the lock infrastructure of cpufreq using a per cpu rwsem. * Minor restructuring of work callback in ondemand driver. * Use the new cpufreq rwsem infrastructure in ondemand work. This patch: Convert policy->lock to rwsem and move it to per_cpu area. This rwsem will protect against both changing/accessing policy related parameters and CPU hot plug/unplug. [malattia@linux.it: fix oops in kref_put()] Cc: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Cc: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
This commit is contained in:
committed by
Dave Jones
parent
c120069779
commit
5a01f2e8f3
@ -84,9 +84,6 @@ struct cpufreq_policy {
|
||||
unsigned int policy; /* see above */
|
||||
struct cpufreq_governor *governor; /* see below */
|
||||
|
||||
struct mutex lock; /* CPU ->setpolicy or ->target may
|
||||
only be called once a time */
|
||||
|
||||
struct work_struct update; /* if update_policy() needs to be
|
||||
* called, but you're in IRQ context */
|
||||
|
||||
@ -172,11 +169,16 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy,
|
||||
unsigned int relation);
|
||||
|
||||
|
||||
extern int cpufreq_driver_getavg(struct cpufreq_policy *policy);
|
||||
extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy);
|
||||
|
||||
int cpufreq_register_governor(struct cpufreq_governor *governor);
|
||||
void cpufreq_unregister_governor(struct cpufreq_governor *governor);
|
||||
|
||||
int lock_policy_rwsem_read(int cpu);
|
||||
int lock_policy_rwsem_write(int cpu);
|
||||
void unlock_policy_rwsem_read(int cpu);
|
||||
void unlock_policy_rwsem_write(int cpu);
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
* CPUFREQ DRIVER INTERFACE *
|
||||
|
Reference in New Issue
Block a user