From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org,
Corey Ashford <cjashfor@linux.vnet.ibm.com>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 2/2] perf_counter: optimize context switch between identical inherited contexts
Date: Fri, 22 May 2009 12:08:17 +0200 [thread overview]
Message-ID: <1242986897.26820.638.camel@twins> (raw)
In-Reply-To: <18966.30400.611789.434936@cargo.ozlabs.ibm.com>
On Fri, 2009-05-22 at 19:56 +1000, Paul Mackerras wrote:
> Peter Zijlstra writes:
>
> > On Fri, 2009-05-22 at 14:27 +1000, Paul Mackerras wrote:
> > > Since we don't have individual fds for the counters in a cloned
> > > context, the only thing that can make two clones of a given parent
> > > different after they have been cloned is enabling or disabling all
> > > counters with prctl. To account for this, we keep a count of the
> > > number of enabled counters in each context. Two contexts must have
> > > the same number of enabled counters to be considered equivalent.
> >
> > Curious point that.. so prctl() can disable counters it doesn't own.
> >
> > Shouldn't we instead fix that?
>
> Well, prctl enables/disables the counters that are counting on the
> current process, regardless of who or what created them. I always
> thought that was a little strange; maybe it is useful to be able to
> disable all the counters that any other process might have put on to
> you, but I can't think of a scenario where you'd really need to do
> that, particularly since the disable is a one-shot operation, and
> doesn't prevent new (enabled) counters being attached to you.
>
> On the other hand, what does "all the counters I own" mean? Does it
> mean all the ones that I have fds open for? Or does it mean all the
> ones that I created? Either way we don't have a good way to enumerate
> them.
I'm for all counters you created (ie have a fd for). Being able to
disable counters others created on you just sounds wrong.
If we can settle on a semantic, I'm sure we can implement it :-)
Ingo, Corey, any opinions?
next prev parent reply other threads:[~2009-05-22 10:08 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-22 4:17 [PATCH 1/2] perf_counter: dynamically allocate tasks' perf_counter_context struct [v2] Paul Mackerras
2009-05-22 4:27 ` [PATCH 2/2] perf_counter: optimize context switch between identical inherited contexts Paul Mackerras
2009-05-22 8:16 ` Peter Zijlstra
2009-05-22 9:56 ` Paul Mackerras
2009-05-22 10:08 ` Peter Zijlstra [this message]
2009-05-23 12:38 ` Ingo Molnar
2009-05-23 13:06 ` Peter Zijlstra
2009-05-24 23:55 ` Paul Mackerras
2009-05-22 8:32 ` Peter Zijlstra
2009-05-22 8:57 ` Ingo Molnar
2009-05-22 9:02 ` Peter Zijlstra
2009-05-22 10:14 ` Ingo Molnar
2009-05-22 9:29 ` Paul Mackerras
2009-05-22 9:22 ` Peter Zijlstra
2009-05-22 9:42 ` Peter Zijlstra
2009-05-22 10:07 ` Paul Mackerras
2009-05-22 10:05 ` Paul Mackerras
2009-05-22 10:11 ` Ingo Molnar
2009-05-22 10:27 ` [tip:perfcounters/core] perf_counter: Optimize " tip-bot for Paul Mackerras
2009-05-24 11:33 ` Ingo Molnar
2009-05-25 6:18 ` Paul Mackerras
2009-05-25 6:54 ` Ingo Molnar
2009-05-22 10:36 ` [tip:perfcounters/core] perf_counter: fix !PERF_COUNTERS build failure tip-bot for Ingo Molnar
2009-05-22 13:46 ` [PATCH 2/2] perf_counter: optimize context switch between identical inherited contexts Peter Zijlstra
2009-05-25 0:15 ` Paul Mackerras
2009-05-25 10:38 ` Peter Zijlstra
2009-05-25 10:50 ` Peter Zijlstra
2009-05-25 11:06 ` Paul Mackerras
2009-05-25 11:27 ` Peter Zijlstra
2009-05-22 8:06 ` [PATCH 1/2] perf_counter: dynamically allocate tasks' perf_counter_context struct [v2] Peter Zijlstra
2009-05-22 9:30 ` Paul Mackerras
2009-05-22 10:27 ` [tip:perfcounters/core] perf_counter: Dynamically allocate tasks' perf_counter_context struct 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=1242986897.26820.638.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=cjashfor@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.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