aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/profile.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 17:55:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 17:55:46 -0400
commit467a9e1633043810259a7f5368fbcc1e84746137 (patch)
treec8a5bfd2a65455d7f6a59b312e348e069375bd9b /kernel/profile.c
parentb8780c363d808a726a34793caa900923d32b6b80 (diff)
parenta0e247a8059223593f9c5c3d5c1fd50eedf415c0 (diff)
Merge tag 'cpu-hotplug-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull CPU hotplug notifiers registration fixes from Rafael Wysocki: "The purpose of this single series of commits from Srivatsa S Bhat (with a small piece from Gautham R Shenoy) touching multiple subsystems that use CPU hotplug notifiers is to provide a way to register them that will not lead to deadlocks with CPU online/offline operations as described in the changelog of commit 93ae4f978ca7f ("CPU hotplug: Provide lockless versions of callback registration functions"). The first three commits in the series introduce the API and document it and the rest simply goes through the users of CPU hotplug notifiers and converts them to using the new method" * tag 'cpu-hotplug-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (52 commits) net/iucv/iucv.c: Fix CPU hotplug callback registration net/core/flow.c: Fix CPU hotplug callback registration mm, zswap: Fix CPU hotplug callback registration mm, vmstat: Fix CPU hotplug callback registration profile: Fix CPU hotplug callback registration trace, ring-buffer: Fix CPU hotplug callback registration xen, balloon: Fix CPU hotplug callback registration hwmon, via-cputemp: Fix CPU hotplug callback registration hwmon, coretemp: Fix CPU hotplug callback registration thermal, x86-pkg-temp: Fix CPU hotplug callback registration octeon, watchdog: Fix CPU hotplug callback registration oprofile, nmi-timer: Fix CPU hotplug callback registration intel-idle: Fix CPU hotplug callback registration clocksource, dummy-timer: Fix CPU hotplug callback registration drivers/base/topology.c: Fix CPU hotplug callback registration acpi-cpufreq: Fix CPU hotplug callback registration zsmalloc: Fix CPU hotplug callback registration scsi, fcoe: Fix CPU hotplug callback registration scsi, bnx2fc: Fix CPU hotplug callback registration scsi, bnx2i: Fix CPU hotplug callback registration ...
Diffstat (limited to 'kernel/profile.c')
-rw-r--r--kernel/profile.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/kernel/profile.c b/kernel/profile.c
index 1b266dbe755a..cb980f0c731b 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -591,18 +591,28 @@ out_cleanup:
591int __ref create_proc_profile(void) /* false positive from hotcpu_notifier */ 591int __ref create_proc_profile(void) /* false positive from hotcpu_notifier */
592{ 592{
593 struct proc_dir_entry *entry; 593 struct proc_dir_entry *entry;
594 int err = 0;
594 595
595 if (!prof_on) 596 if (!prof_on)
596 return 0; 597 return 0;
597 if (create_hash_tables()) 598
598 return -ENOMEM; 599 cpu_notifier_register_begin();
600
601 if (create_hash_tables()) {
602 err = -ENOMEM;
603 goto out;
604 }
605
599 entry = proc_create("profile", S_IWUSR | S_IRUGO, 606 entry = proc_create("profile", S_IWUSR | S_IRUGO,
600 NULL, &proc_profile_operations); 607 NULL, &proc_profile_operations);
601 if (!entry) 608 if (!entry)
602 return 0; 609 goto out;
603 proc_set_size(entry, (1 + prof_len) * sizeof(atomic_t)); 610 proc_set_size(entry, (1 + prof_len) * sizeof(atomic_t));
604 hotcpu_notifier(profile_cpu_callback, 0); 611 __hotcpu_notifier(profile_cpu_callback, 0);
605 return 0; 612
613out:
614 cpu_notifier_register_done();
615 return err;
606} 616}
607subsys_initcall(create_proc_profile); 617subsys_initcall(create_proc_profile);
608#endif /* CONFIG_PROC_FS */ 618#endif /* CONFIG_PROC_FS */