From: Peter Zijlstra <peterz@infradead.org>
To: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
Cc: Chen LinX <linx.z.chen@intel.com>,
paulus@samba.org, mingo@redhat.com, acme@ghostprotocols.net,
linux-kernel@vger.kernel.org,
Yanmin Zhang <yanmin.zhang@intel.com>
Subject: Re: [PATCH] perf: Don't enable the perf_event without in PERF_ATTACH_CONTEXT status
Date: Tue, 15 Jul 2014 11:58:21 +0200 [thread overview]
Message-ID: <20140715095821.GW9918@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <53C4ECDA.6010501@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1822 bytes --]
On Tue, Jul 15, 2014 at 04:56:58PM +0800, Zhang, Yanmin wrote:
>
> On 2014/7/14 21:27, Peter Zijlstra wrote:
> >On Thu, Jul 03, 2014 at 11:36:38AM +0800, Chen LinX wrote:
> >>From: "Chen LinX" <linx.z.chen@intel.com>
> >>
> >>when do cpu hotplug test and run below perf test together, pmu may access freed perf_event
> >>
> >>while true;
> >>do
> >>perf record -a -g -f sleep 10
> >>rm perf.*
> >>done
> >>
> >>the scenario is that when cpu offline firstly, the 'perf_cpu_notify' will disable event on the
> >>pmu and remove it from the context list. after cpu online, the perf app may enable the event
> >But it does not, right?
>
> Thanks for your kind comments.
> It does, actually.
> The major reason is application calls many syscall to start perf.
> 1) perf_event_open => perf_install_in_context;
> 2) perf_ioctl => perf_event_enable.
That still does not compute; but you're right, it does call
perf_evlist__enable() which ends up calling IOC_ENABLE when there is no
target (ie. things like perf -a), because we created things with
.enable_on_exec=1.
Similar for ->initial_delay cruft.
> >>Signed-off-by: Yanmin Zhang <yanmin.zhang@intel.com>
> >>Signed-off-by: Chen LinX <linx.z.chen@intel.com>
> >Wrong SoB-chain, Yanmin didn't author this patch did he, seeing how From
> >is you. And Yanmin didn't actually send me this patch either.
>
> Lin works with me in the same team. He is smart, but new in kernel upstream
>
> community. I debugged with him and he caught the root cause ahead of me.
Well, then add a Reviewed-by from you or so, the double sob doesn't make
sense.
> The patch is good.
No its not, its got an incomprehensible changelog, and its not at all
clear why the perf_event_enable() path that doesn't use
__perf_event_enable() is correct.
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2014-07-15 9:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-03 3:36 [PATCH] perf: Don't enable the perf_event without in PERF_ATTACH_CONTEXT status Chen LinX
2014-07-14 12:15 ` Peter Zijlstra
2014-07-14 13:27 ` Peter Zijlstra
2014-07-15 8:56 ` Zhang, Yanmin
2014-07-15 9:58 ` Peter Zijlstra [this message]
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=20140715095821.GW9918@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=acme@ghostprotocols.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linx.z.chen@intel.com \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=yanmin.zhang@intel.com \
--cc=yanmin_zhang@linux.intel.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