From: Frederic Weisbecker <fweisbec@gmail.com>
To: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Cc: paulus@samba.org, a.p.zijlstra@chello.nl,
linux-kernel@vger.kernel.org, mingo@redhat.com,
emachado@linux.vnet.ibm.com, acme@ghostprotocols.net,
prasad.krishnan@gmail.com
Subject: Re: [PATCH v2 RESEND] Hardware breakpoints: Invoke __perf_event_disable() if interrupts are already disabled
Date: Tue, 31 Jul 2012 15:41:28 +0200 [thread overview]
Message-ID: <20120731134124.GD17078@somewhere.redhat.com> (raw)
In-Reply-To: <500FD968.6000407@linux.vnet.ibm.com>
On Wed, Jul 25, 2012 at 05:02:56PM +0530, Naveen N. Rao wrote:
> >>>@@ -453,7 +453,15 @@ int modify_user_hw_breakpoint(struct perf_event
> >>>*bp, struct perf_event_attr *att
> >>> int old_type = bp->attr.bp_type;
> >>> int err = 0;
> >>>
> >>>- perf_event_disable(bp);
> >>>+ /*
> >>>+ * modify_user_hw_breakpoint can be invoked with IRQs disabled
> >>>and hence it
> >>>+ * will not be possible to raise IPIs that invoke
> >>>__perf_event_disable.
> >>>+ * So call the function directly.
> >>>+ */
> >>>+ if (irqs_disabled())
> >>>+ __perf_event_disable(bp);
> >>>+ else
> >>>+ perf_event_disable(bp);
> >>
> >>This only works if we are sure the bp is on the current CPU. Do we
> >>have that guarantee?
> >
> >Yes. This is being hit during bp exception processing and is specific to
> >ppc where we disable interrupts:
> >hw_breakpoint_handler->perf_bp_event->ptrace_triggered->modify_user_hw_breakpoint()
>
> Frederick,
> Is this acceptable, or do you have other scenarios where this won't
> work? I can add a check to ensure we call __perf_event_disable only
> if the task is on the current CPU, but the above scenario is the
> only one where we're seeing this issue.
Yeah, please make sure that the targeted task is "current".
next prev parent reply other threads:[~2012-07-31 13:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-11 6:02 [Patch][perf] Invoke __perf_event_disable without an IPI K.Prasad
2012-06-11 11:13 ` Peter Zijlstra
2012-06-12 6:06 ` K.Prasad
2012-06-12 9:12 ` Peter Zijlstra
2012-07-06 9:52 ` [PATCH v2] Hardware breakpoints: Invoke __perf_event_disable() if interrupts are already disabled Naveen N. Rao
2012-07-06 10:18 ` Naveen N. Rao
2012-07-18 10:30 ` [PATCH v2 RESEND] " Naveen N. Rao
2012-07-18 11:57 ` Frederic Weisbecker
2012-07-19 11:16 ` Naveen N. Rao
2012-07-25 11:32 ` Naveen N. Rao
2012-07-31 13:41 ` Frederic Weisbecker [this message]
2012-08-02 8:16 ` [PATCH v3] " Naveen N. Rao
2012-08-15 17:37 ` Naveen N. Rao
2012-08-15 18:42 ` Frederic Weisbecker
2012-08-16 8:16 ` Peter Zijlstra
2012-08-29 2:45 ` Naveen N. Rao
2012-09-04 18:53 ` [tip:perf/urgent] perf/hwpb: " tip-bot for K.Prasad
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=20120731134124.GD17078@somewhere.redhat.com \
--to=fweisbec@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=emachado@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=paulus@samba.org \
--cc=prasad.krishnan@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).