Skip to content

cpufreq: cpufreq_driver_lock is hot on large systems

Nathan Zimmer cpufreq linux-pm lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest2 patches 12 repliesIn review
  2. v42 patches 5 repliesSuperseded
  3. v32 patches 2 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches10 repliesSuperseded
v12 patches8 repliesSuperseded

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2cpufreq: split the cpufreq_driver_lock and use the rcudrivers/cpufreq/cpufreq.c+219 -837 replies
2/2cpufreq: covert the cpufreq_data_lock to a spinlockdrivers/cpufreq/cpufreq.c+19 -195 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.

Read the v6 thread

Cover letter [PATCH v6 0/2] cpufreq: cpufreq_driver_lock is hot on large systems

I am noticing the cpufreq_driver_lock is quite hot.
On an idle 512 system perf shows me most of the system time is spent on this lock. This is quite significant as top shows 5% of time in system time. My solution was to first split the lock into two parts, cpu_driver_lock and cpu_data_lock, with the cpufreq_driver also being protected by the RCU. There was measurable heat left on the cpufreq_data_lock in __cpufreq_cpu_get. So in the second part I converted the cpufreq_data_lock to be a rw lock since an rcu solution was not apparent, at least to me.

v5: Go a different way and split up the lock and use the rcu
v6: use bools instead of checking function pointers
covert the cpufreq_data_lock to a rwlock

Nathan Zimmer (2):
cpufreq: split the cpufreq_driver_lock and use the rcu
cpufreq: covert the cpufreq_data_lock to a spinlock

 drivers/cpufreq/cpufreq.c | 302 +++++++++++++++++++++++++++++++++-------------
 1 file changed, 219 insertions(+), 83 deletions(-)
Signature · 1 line
1.8.1.2