From: "Yan, Zheng" <zheng.z.yan@intel.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: a.p.zijlstra@chello.nl, mingo@elte.hu, eranian@google.com,
linux-kernel@vger.kernel.org, ming.m.lin@intel.com
Subject: Re: [PATCH 2/5] perf: generic intel uncore support
Date: Wed, 28 Mar 2012 19:24:16 +0800 [thread overview]
Message-ID: <4F72F4E0.6010609@intel.com> (raw)
In-Reply-To: <20120328092446.GY22197@one.firstfloor.org>
On 03/28/2012 05:24 PM, Andi Kleen wrote:
> Overall the driver looks rather good. Thanks.
>
> On Wed, Mar 28, 2012 at 02:43:15PM +0800, Yan, Zheng wrote:
>> +static void uncore_perf_event_update(struct intel_uncore_box *box,
>> + struct perf_event *event)
>> +{
>> + raw_spin_lock(&box->lock);
>
> I think a raw lock would be only needed if the uncore was called
> from the scheduler context switch, which it should not be.
>
> So you can use a normal lock instead of a raw lock.
>
>
>> +static void uncore_pmu_start_hrtimer(struct intel_uncore_box *box)
>> +{
>> + __hrtimer_start_range_ns(&box->hrtimer,
>> + ns_to_ktime(UNCORE_PMU_HRTIMER_INTERVAL), 0,
>> + HRTIMER_MODE_REL_PINNED, 0);
>> +}
>
> Can probably do some slack to be more friendly for power.
>
>> +static struct intel_uncore_box *
>> +uncore_pmu_find_box(struct intel_uncore_pmu *pmu, int phyid)
>> +{
>> + struct intel_uncore_box *box;
>> +
>> + rcu_read_lock();
>
> I'm not sure RCU is really needed here, are any of those paths
> time critical? But ok shouldn't hurt either.
>
It's not time critical. but using RCU here is as simple as
using lock. So I decided to use RCU.
>> +static int __init uncore_cpu_init(void)
>> +{
>> + int ret, cpu;
>> +
>> + switch (boot_cpu_data.x86_model) {
>> + default:
>> + return 0;
>> + }
>
> Needs a case? Always returns?
later patches add code to here
>
>> +
>> + ret = uncore_types_init(msr_uncores);
>> + if (ret)
>> + return ret;
>> +
>> + get_online_cpus();
>> + for_each_online_cpu(cpu)
>> + uncore_cpu_prepare(cpu);
>> +
>> + preempt_disable();
>> + smp_call_function(uncore_cpu_setup, NULL, 1);
>> + uncore_cpu_setup(NULL);
>> + preempt_enable();
>
> That's on_each_cpu()
>
will switch to on_each_cpu() in later version of patches
Thanks
Yan, Zheng
>
> -Andi
next prev parent reply other threads:[~2012-03-28 11:24 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-28 6:43 [RFC PATCH 0/5] perf: Intel uncore pmu counting support Yan, Zheng
2012-03-28 6:43 ` [PATCH 1/5] perf: Export perf_assign_events Yan, Zheng
2012-03-28 6:43 ` [PATCH 2/5] perf: generic intel uncore support Yan, Zheng
2012-03-28 9:24 ` Andi Kleen
2012-03-28 9:38 ` Peter Zijlstra
2012-03-28 11:24 ` Yan, Zheng [this message]
2012-03-31 3:18 ` Peter Zijlstra
2012-04-01 3:11 ` Yan, Zheng
2012-04-02 22:10 ` Peter Zijlstra
2012-04-02 22:11 ` Peter Zijlstra
2012-04-03 8:28 ` Yan, Zheng
2012-04-03 14:29 ` Peter Zijlstra
2012-04-04 1:47 ` Yan, Zheng
2012-04-10 0:48 ` Yan, Zheng
2012-04-16 12:11 ` Peter Zijlstra
2012-04-02 22:16 ` Peter Zijlstra
2012-04-02 22:24 ` Peter Zijlstra
2012-04-16 12:07 ` Peter Zijlstra
2012-04-17 6:56 ` Yan, Zheng
2012-03-28 6:43 ` [PATCH 3/5] perf: Add Nehalem and Sandy Bridge " Yan, Zheng
2012-03-28 6:43 ` [PATCH 4/5] perf: Generic pci uncore device support Yan, Zheng
2012-03-28 6:43 ` [PATCH 5/5] perf: Add Sandy Bridge-EP uncore support Yan, Zheng
2012-03-28 6:49 ` [RFC PATCH 0/5] perf: Intel uncore pmu counting support Ingo Molnar
2012-03-28 8:49 ` Peter Zijlstra
2012-03-28 9:02 ` Yan, Zheng
2012-03-28 8:57 ` Andi Kleen
2012-03-28 9:30 ` Ingo Molnar
2012-03-28 10:58 ` 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=4F72F4E0.6010609@intel.com \
--to=zheng.z.yan@intel.com \
--cc=a.p.zijlstra@chello.nl \
--cc=andi@firstfloor.org \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.m.lin@intel.com \
--cc=mingo@elte.hu \
/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.