From: Stephane Eranian <eranian@google.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
"mingo@elte.hu" <mingo@elte.hu>,
"ak@linux.intel.com" <ak@linux.intel.com>,
"Yan, Zheng" <zheng.z.yan@intel.com>,
Robert Richter <robert.richter@amd.com>
Subject: Re: [PATCH v2 2/3] perf: use hrtimer for event multiplexing
Date: Wed, 12 Sep 2012 16:43:38 +0200 [thread overview]
Message-ID: <CABPqkBREFbnJb4C3CqXc0RkKZDXZeCG8S75p3h=fUFNz1TWH-Q@mail.gmail.com> (raw)
In-Reply-To: <1347459764.15764.32.camel@twins>
On Wed, Sep 12, 2012 at 4:22 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> On Wed, 2012-09-12 at 16:13 +0200, Stephane Eranian wrote:
>> +static DEFINE_PER_CPU(struct list_head, rotation_list);
>
> Why do you keep the rotation list? The only use seems to be:
>
>
>> +void perf_cpu_hrtimer_cancel(int cpu)
>> +{
>> + struct list_head *head = &__get_cpu_var(rotation_list);
>> + struct perf_cpu_context *cpuctx, *tmp;
>> + unsigned long flags;
>> +
>> + if (WARN_ON(cpu != smp_processor_id()))
>> + return;
>> +
>> + local_irq_save(flags);
>> +
>> + list_for_each_entry_safe(cpuctx, tmp, head, rotation_list) {
>> + if (cpuctx->hrtimer_active) {
>> + hrtimer_cancel(&cpuctx->hrtimer);
>> + cpuctx->hrtimer_active = 0;
>> + }
>> + }
>> +
>> + local_irq_restore(flags);
>> +}
>
> Which is weird, why not use the existing for-each-pmu loop in
> perf_event_exit_cpu_context() ? Or something similar to iterate all
> extant PMUs and thus their cpuctxs?
>
True. That would probably work too.
> Also, you can do away with hrtimer_active, you can hrtimer_cancel() on
> an inactive hrtimer just fine, it will DTRT.
The hrtimer_active is used to prevent activating the timer multiple times
in a row.
next prev parent reply other threads:[~2012-09-12 14:43 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-12 14:13 [PATCH v2 0/3] perf: use hrtimer for event multiplexing Stephane Eranian
2012-09-12 14:13 ` [PATCH v2 1/3] hrtimer: add hrtimer_init_cpu() Stephane Eranian
2012-09-12 14:22 ` Eric Dumazet
2012-09-12 14:26 ` Peter Zijlstra
2012-09-12 14:33 ` Stephane Eranian
2012-09-12 14:38 ` Peter Zijlstra
2012-09-12 14:46 ` Stephane Eranian
2012-09-12 14:49 ` Peter Zijlstra
2012-09-12 14:51 ` Stephane Eranian
2012-09-12 14:13 ` [PATCH v2 2/3] perf: use hrtimer for event multiplexing Stephane Eranian
2012-09-12 14:22 ` Peter Zijlstra
2012-09-12 14:43 ` Stephane Eranian [this message]
2012-09-12 14:44 ` Peter Zijlstra
2012-09-12 14:48 ` Stephane Eranian
2012-09-12 14:50 ` Peter Zijlstra
2012-09-12 15:37 ` Stephane Eranian
2012-09-12 15:49 ` Stephane Eranian
2012-09-13 12:16 ` Peter Zijlstra
2012-09-13 12:20 ` Stephane Eranian
2012-09-13 12:26 ` Peter Zijlstra
2012-09-13 12:27 ` Stephane Eranian
2012-09-13 12:29 ` Peter Zijlstra
2012-09-12 14:13 ` [PATCH v2 3/3] perf: add sysfs entry to adjust multiplexing interval per PMU Stephane Eranian
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='CABPqkBREFbnJb4C3CqXc0RkKZDXZeCG8S75p3h=fUFNz1TWH-Q@mail.gmail.com' \
--to=eranian@google.com \
--cc=ak@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=robert.richter@amd.com \
--cc=zheng.z.yan@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;
as well as URLs for NNTP newsgroup(s).