From: Paul Mackerras <paulus@samba.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf_counter: Provide functions for locking and pinning the context for a task
Date: Tue, 2 Jun 2009 15:37:36 +1000 [thread overview]
Message-ID: <18980.47776.940214.789245@drongo.ozlabs.ibm.com> (raw)
In-Reply-To: <20090601231428.GF749@elte.hu>
Ingo Molnar writes:
> Yeah, indeed that box has a CPU hotplug testcase - sets cpu1 to
> offline then online.
>
> There should be no counters active anywhere during that.
OK, I can't reproduce this on powerpc. I guess you have dynamic
per-cpu patches in there, and per-cpu areas are getting reinitialized
when cpus come up. That, combined with the fact that the
migration_notifier in kernel/sched.c puts itself at priority 10, means
that we're getting a call to perf_counter_task_migration() for a
newly-added CPU before perf_cpu_notify() has been called for that CPU,
and so we're trying to use an uninitialized perf_cpu_context and we go
boom.
Could you try the same test with this patch? If this fixes it, then
that's what the problem is. It's up to you whether increasing the
priority on perf_cpu_nb is the right solution or whether we should
solve the problem some other way.
Paul.
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
--- 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)
return NOTIFY_OK;
}
+/*
+ * This has to have a higher priority than migration_notifier in sched.c.
+ */
static struct notifier_block __cpuinitdata perf_cpu_nb = {
.notifier_call = perf_cpu_notify,
+ .priority = 20,
};
void __init perf_counter_init(void)
next prev parent reply other threads:[~2009-06-02 5:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-01 7:48 Paul Mackerras
2009-06-01 7:49 ` [PATCH] perf_counter: Allow software counters to count while task is not running Paul Mackerras
2009-06-01 8:19 ` [tip:perfcounters/core] " tip-bot for Paul Mackerras
2009-06-01 7:52 ` [PATCH] perf_counter: Fix cpu migration counter Paul Mackerras
2009-06-01 8:19 ` [tip:perfcounters/core] " tip-bot for Paul Mackerras
2009-06-02 14:18 ` tip-bot for Paul Mackerras
2009-06-01 7:53 ` [PATCH] perf_counter: Remove unused prev_state field Paul Mackerras
2009-06-01 8:19 ` [tip:perfcounters/core] " tip-bot for Paul Mackerras
2009-06-02 14:18 ` tip-bot for Paul Mackerras
2009-06-01 7:55 ` [PATCH] perf_counter: Provide functions for locking and pinning the context for a task Paul Mackerras
2009-06-01 16:21 ` Ingo Molnar
2009-06-01 21:38 ` Paul Mackerras
2009-06-01 23:14 ` Ingo Molnar
2009-06-02 5:37 ` Paul Mackerras [this message]
2009-06-02 7:56 ` Ingo Molnar
2009-06-01 8:18 ` [tip:perfcounters/core] " tip-bot for Paul Mackerras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18980.47776.940214.789245@drongo.ozlabs.ibm.com \
--to=paulus@samba.org \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®