From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: paulmck@linux.vnet.ibm.com
Cc: peterz@infradead.org, acme@ghostprotocols.net, mingo@kernel.org,
tglx@linutronix.de, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH 1/2] perf, cpu hotplug: Run CPU_STARTING notifiers with irqs disabled
Date: Tue, 16 Oct 2012 22:07:15 +0530 [thread overview]
Message-ID: <507D8D3B.5000506@linux.vnet.ibm.com> (raw)
In-Reply-To: <20121016163140.GA2385@linux.vnet.ibm.com>
On 10/16/2012 10:01 PM, Paul E. McKenney wrote:
> On Tue, Oct 16, 2012 at 01:28:10PM +0530, Srivatsa S. Bhat wrote:
>> The CPU_STARTING notifiers are supposed to be run with irqs disabled. But the
>> perf_cpu_notifier() macro invokes them without doing that. Fix it.
>
> Color me confused...
Hehe, I believe the context provided by diff tricked you ;-)
The function I am referring to is perf_cpu_notifier(), not
perf_event_task_tick() :-)
Regards,
Srivatsa S. Bhat
> Isn't perf_event_task_tick() invoked only
> from scheduler_tick(), which always has interrupts disabled?
>
> Or are you needing to invoke it from somewhere else?
>
> Thanx, Paul
>
>> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
>> ---
>>
>> include/linux/perf_event.h | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
>> index 2e90235..0647805 100644
>> --- a/include/linux/perf_event.h
>> +++ b/include/linux/perf_event.h
>> @@ -803,10 +803,13 @@ static inline void perf_event_task_tick(void) { }
>> do { \
>> static struct notifier_block fn##_nb __cpuinitdata = \
>> { .notifier_call = fn, .priority = CPU_PRI_PERF }; \
>> + unsigned long flags; \
>> fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE, \
>> (void *)(unsigned long)smp_processor_id()); \
>> + local_irq_save(flags); \
>> fn(&fn##_nb, (unsigned long)CPU_STARTING, \
>> (void *)(unsigned long)smp_processor_id()); \
>> + local_irq_restore(flags); \
>> fn(&fn##_nb, (unsigned long)CPU_ONLINE, \
>> (void *)(unsigned long)smp_processor_id()); \
>> register_cpu_notifier(&fn##_nb); \
>>
next prev parent reply other threads:[~2012-10-16 16:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-16 7:58 [RESEND PATCH 1/2] perf, cpu hotplug: Run CPU_STARTING notifiers with irqs disabled Srivatsa S. Bhat
2012-10-16 7:58 ` [RESEND PATCH 2/2] perf, cpu hotplug: Use cached value of smp_processor_id() Srivatsa S. Bhat
2012-10-16 16:32 ` Paul E. McKenney
2012-10-24 9:40 ` [tip:perf/core] " tip-bot for Srivatsa S. Bhat
2012-10-16 16:31 ` [RESEND PATCH 1/2] perf, cpu hotplug: Run CPU_STARTING notifiers with irqs disabled Paul E. McKenney
2012-10-16 16:37 ` Srivatsa S. Bhat [this message]
2012-10-16 18:34 ` Paul E. McKenney
2012-10-17 4:48 ` Srivatsa S. Bhat
2012-10-24 9:39 ` [tip:perf/core] " tip-bot for Srivatsa S. Bhat
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=507D8D3B.5000506@linux.vnet.ibm.com \
--to=srivatsa.bhat@linux.vnet.ibm.com \
--cc=acme@ghostprotocols.net \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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