All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lin Ming <ming.m.lin@intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	Matt Fleming <matt@console-pimps.org>,
	"Zhang, Rui" <rui.zhang@intel.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	lkml <linux-kernel@vger.kernel.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [RFC PATCH 1/2] perf: Enable group siblings on exec if attr::enable_on_exec set
Date: Wed, 10 Nov 2010 22:49:03 +0800	[thread overview]
Message-ID: <1289400543.2479.41.camel@localhost> (raw)
In-Reply-To: <1289399915.2191.127.camel@laptop>

On Wed, 2010-11-10 at 22:38 +0800, Peter Zijlstra wrote:
> On Wed, 2010-11-10 at 22:17 +0800, Lin Ming wrote:
> > On Wed, 2010-11-10 at 20:19 +0800, Peter Zijlstra wrote:
> > > On Wed, 2010-11-10 at 14:15 +0800, Lin Ming wrote:
> > > > Currently, only group leader is enabled on exec.
> > > 
> > > That's enough, right? If all sibling events are already enabled enabling
> > > the group leader makes the whole thing go.
> > 
> > No.
> > 
> > If the event group is disabled by default("perf stat" case) and will be
> > enabled at next exec, then actually only the group leader will be
> > enabled , because all siblings are explicitly disabled(->state ==
> > PERF_EVENT_STATE_OFF). So the siblings will never be enabled.
> 
> Right, so what I was saying is, don't disable all the siblings by
> default, so that only the group leader will be disabled. In that case
> nothing will get scheduled because the group leader is not enabled.
> 
> So: {disabled, enabled, enabled} will not actually get scheduled and the
> group as a whole is effectively disabled. Once the enabled_on_exec flips
> the group leader to 'enabled' the whole group becomes enabled.
> 
> I don't mind the patch too much (although I would like to avoid that
> double sibling iteration in both group_enable_on_exec() and
> __perf_event_mark_enabled()), but I think it can already work as is.

I got it now!

Another stupid patch, sorry.



  reply	other threads:[~2010-11-10 14:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-10  6:15 [RFC PATCH 1/2] perf: Enable group siblings on exec if attr::enable_on_exec set Lin Ming
2010-11-10 12:19 ` Peter Zijlstra
2010-11-10 14:17   ` Lin Ming
2010-11-10 14:38     ` Peter Zijlstra
2010-11-10 14:49       ` Lin Ming [this message]
2010-11-10 14:54         ` Peter Zijlstra

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=1289400543.2479.41.camel@localhost \
    --to=ming.m.lin@intel.com \
    --cc=acme@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@console-pimps.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rui.zhang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.