Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1627366

[tip:smp/hotplug] cpufreq: Use cpuhp_setup_state_nocalls_cpuslocked()

From tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com>
Newsgroups linux.kernel
Subject [tip:smp/hotplug] cpufreq: Use cpuhp_setup_state_nocalls_cpuslocked()
Date 2017-04-20 13:30 +0200
Message-ID <tyirF-8jz-39@gated-at.bofh.it> (permalink)
References <txHs7-1Kl-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Commit-ID:  6d7d2f1f9e6e0c2d6fb9de82ad5fbc3aed115829
Gitweb:     http://git.kernel.org/tip/6d7d2f1f9e6e0c2d6fb9de82ad5fbc3aed115829
Author:     Sebastian Andrzej Siewior <bigeasy@linutronix.de>
AuthorDate: Tue, 18 Apr 2017 19:04:48 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 20 Apr 2017 13:08:52 +0200

cpufreq: Use cpuhp_setup_state_nocalls_cpuslocked()

cpufreq holds get_online_cpus() while invoking cpuhp_setup_state_nocalls()
to make subsys_interface_register() and the registration of hotplug calls
atomic versus cpu hotplug.

cpuhp_setup_state_nocalls() invokes get_online_cpus() as well. This is
correct, but prevents the conversion of the hotplug locking to a percpu
rwsem.

Use cpuhp_setup/remove_state_nocalls_cpuslocked() to avoid the nested call.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-pm@vger.kernel.org
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20170418170552.865966021@linutronix.de

---
 drivers/cpufreq/cpufreq.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 0e3f649..67ef7ce 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2473,9 +2473,10 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
 		goto err_if_unreg;
 	}
 
-	ret = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "cpufreq:online",
-					cpuhp_cpufreq_online,
-					cpuhp_cpufreq_offline);
+	ret = cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ONLINE_DYN,
+						   "cpufreq:online",
+						   cpuhp_cpufreq_online,
+						   cpuhp_cpufreq_offline);
 	if (ret < 0)
 		goto err_if_unreg;
 	hp_online = ret;
@@ -2519,7 +2520,7 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver)
 	get_online_cpus();
 	subsys_interface_unregister(&cpufreq_interface);
 	remove_boost_sysfs_file();
-	cpuhp_remove_state_nocalls(hp_online);
+	cpuhp_remove_state_nocalls_cpuslocked(hp_online);
 
 	write_lock_irqsave(&cpufreq_driver_lock, flags);
 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[patch V2 00/24] cpu/hotplug: Convert get_online_cpus() to a  percpu_rwsem Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 21:50 +0200
  [patch V2 03/24] padata: Make padata_alloc() static Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 21:50 +0200
    [tip:smp/hotplug] padata: Make padata_alloc() static tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-04-20 13:30 +0200
  [patch V2 20/24] perf/core: Remove redundant get_online_cpus() Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
    [tip:smp/hotplug] perf/core: Remove redundant get_online_cpus() tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-04-20 13:40 +0200
  [patch V2 22/24] jump_label: Provide static_key_slow_inc_cpuslocked() Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
  [patch V2 15/24] x86/perf: Drop EXPORT of perf_check_microcode Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
    [tip:smp/hotplug] x86/perf: Drop EXPORT of perf_check_microcode tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-04-20 13:30 +0200
  [patch V2 09/24] hwtracing/coresight-etm4x: Use  cpuhp_setup_state_nocalls_cpuslocked() Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
    [tip:smp/hotplug] hwtracing/coresight-etm4x: Use  cpuhp_setup_state_nocalls_cpuslocked() tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2017-04-20 13:30 +0200
  [patch V2 23/24] perf: Avoid cpu_hotplug_lock r-r recursion Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
  [patch V2 16/24] perf/x86/intel: Drop get_online_cpus() in  intel_snb_check_microcode() Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
    [tip:smp/hotplug] perf/x86/intel: Drop get_online_cpus() in  intel_snb_check_microcode() tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2017-04-20 13:40 +0200
  [patch V2 24/24] cpu/hotplug: Convert hotplug locking to percpu rwsem Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
    [tip:smp/hotplug] cpu/hotplug: Convert hotplug locking to percpu  rwsem tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-04-20 13:40 +0200
  [patch V2 05/24] x86/mtrr: Remove get_online_cpus() from  mtrr_save_state() Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
    [tip:smp/hotplug] x86/mtrr: Remove get_online_cpus() from  mtrr_save_state() tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2017-04-20 13:30 +0200
  [patch V2 14/24] cpu/hotplug: Use stop_machine_cpuslocked() in  takedown_cpu() Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
    [tip:smp/hotplug] cpu/hotplug: Use stop_machine_cpuslocked() in  takedown_cpu() tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2017-04-20 13:30 +0200
  [patch V2 18/24] PCI: Replace the racy recursion prevention Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
    [tip:smp/hotplug] PCI: Replace the racy recursion prevention tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-04-20 13:40 +0200
  [patch V2 21/24] jump_label: Pull get_online_cpus() into generic code Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
  [patch V2 12/24] s390/kernel: Use stop_machine_cpuslocked() Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
    [tip:smp/hotplug] s390/kernel: Use stop_machine_cpuslocked() tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2017-04-20 13:30 +0200
  [patch V2 06/24] cpufreq: Use cpuhp_setup_state_nocalls_cpuslocked() Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
    [tip:smp/hotplug] cpufreq: Use  cpuhp_setup_state_nocalls_cpuslocked() tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2017-04-20 13:30 +0200
  [patch V2 19/24] ACPI/processor: Use cpu_hotplug_disable() instead of  get_online_cpus() Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
    [tip:smp/hotplug] ACPI/processor: Use cpu_hotplug_disable() instead  of get_online_cpus() tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-04-20 13:40 +0200
  [patch V2 08/24] hwtracing/coresight-etm3x: Use  cpuhp_setup_state_nocalls_cpuslocked() Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
    [tip:smp/hotplug] hwtracing/coresight-etm3x: Use  cpuhp_setup_state_nocalls_cpuslocked() tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2017-04-20 13:30 +0200
    Re: [patch V2 08/24] hwtracing/coresight-etm3x: Use cpuhp_setup_state_nocalls_cpuslocked() Mathieu Poirier <mathieu.poirier@linaro.org> - 2017-04-20 17:20 +0200
    Re: [patch V2 08/24] hwtracing/coresight-etm3x: Use  cpuhp_setup_state_nocalls_cpuslocked() Mathieu Poirier <mathieu.poirier@linaro.org> - 2017-04-20 17:40 +0200
  [patch V2 17/24] PCI: Use cpu_hotplug_disable() instead of  get_online_cpus() Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
    [tip:smp/hotplug] PCI: Use cpu_hotplug_disable() instead of  get_online_cpus() tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-04-20 13:40 +0200
  [patch V2 13/24] powerpc/powernv: Use stop_machine_cpuslocked() Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
    [tip:smp/hotplug] powerpc/powernv: Use stop_machine_cpuslocked() tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2017-04-20 13:30 +0200
  [patch V2 11/24] ARM/hw_breakpoint: Use cpuhp_setup_state_cpuslocked() Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
    Re: [patch V2 11/24] ARM/hw_breakpoint: Use  cpuhp_setup_state_cpuslocked() Mark Rutland <mark.rutland@arm.com> - 2017-04-19 20:00 +0200
      Re: [patch V2 11/24] ARM/hw_breakpoint: Use  cpuhp_setup_state_cpuslocked() Thomas Gleixner <tglx@linutronix.de> - 2017-04-19 20:30 +0200
    [tip:smp/hotplug] ARM/hw_breakpoint: Use  cpuhp_setup_state_cpuslocked() tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2017-04-20 13:30 +0200
  [patch V2 07/24] KVM/PPC/Book3S HV: Use  cpuhp_setup_state_nocalls_cpuslocked() Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
    [tip:smp/hotplug] KVM/PPC/Book3S HV: Use  cpuhp_setup_state_nocalls_cpuslocked() tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2017-04-20 13:30 +0200
  [patch V2 10/24] perf/x86/intel/cqm: Use  cpuhp_setup_state_cpuslocked() Thomas Gleixner <tglx@linutronix.de> - 2017-04-18 22:00 +0200
    [tip:smp/hotplug] perf/x86/intel/cqm: Use  cpuhp_setup_state_cpuslocked() tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2017-04-20 13:30 +0200

csiph-web