diff options
author | Paul Mackerras <paulus@samba.org> | 2009-06-02 07:05:16 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-02 07:10:54 -0400 |
commit | f38b082081bf69a06fffb8b32a175999e2320c5b (patch) | |
tree | 08a26857c77b11a97871b3e1e06ec588033f7cf3 /kernel/perf_counter.c | |
parent | 10a2825514a988225ac2e336c7a9502c4ca57c39 (diff) |
perf_counter: Initialize per-cpu context earlier on cpu up
This arranges for perf_counter's notifier for cpu hotplug
operations to be called earlier than the migration notifier in
sched.c by increasing its priority to 20, compared to the 10
for the migration notifier. The reason for doing this is that
a subsequent commit to convert the cpu migration counter to use
the generic swcounter infrastructure will add a call into the
perf_counter subsystem when tasks get migrated. Therefore the
perf_counter subsystem needs a chance to initialize its per-cpu
data for the new cpu before it can get called from the
migration code.
This also adds a comment to the migration notifier noting that
its priority needs to be lower than that of the perf_counter
notifier.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <18981.1900.792795.836858@cargo.ozlabs.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/perf_counter.c')
-rw-r--r-- | kernel/perf_counter.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index df319c48c52b..8d2653f137e9 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
@@ -3902,8 +3902,12 @@ perf_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) | |||
3902 | return NOTIFY_OK; | 3902 | return NOTIFY_OK; |
3903 | } | 3903 | } |
3904 | 3904 | ||
3905 | /* | ||
3906 | * This has to have a higher priority than migration_notifier in sched.c. | ||
3907 | */ | ||
3905 | static struct notifier_block __cpuinitdata perf_cpu_nb = { | 3908 | static struct notifier_block __cpuinitdata perf_cpu_nb = { |
3906 | .notifier_call = perf_cpu_notify, | 3909 | .notifier_call = perf_cpu_notify, |
3910 | .priority = 20, | ||
3907 | }; | 3911 | }; |
3908 | 3912 | ||
3909 | void __init perf_counter_init(void) | 3913 | void __init perf_counter_init(void) |