From: "Yan, Zheng" <zheng.z.yan@intel.com>
To: Stephane Eranian <eranian@google.com>
Cc: Ingo Molnar <mingo@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnaldo Carvalho de Melo <acme@infradead.org>,
Andi Kleen <andi@firstfloor.org>
Subject: Re: [PATCH v2 4/4] perf/x86/uncore: modularize Intel uncore driver
Date: Thu, 24 Apr 2014 18:37:54 +0800 [thread overview]
Message-ID: <5358E982.4030106@intel.com> (raw)
In-Reply-To: <CABPqkBRihMr=+X_Gb5dSYfForTpGA6XZGfTHOA3PZNAHTJDPkg@mail.gmail.com>
On 04/24/2014 06:36 PM, Stephane Eranian wrote:
> On Thu, Apr 24, 2014 at 12:25 PM, Yan, Zheng <zheng.z.yan@intel.com> wrote:
>> On 04/24/2014 04:14 PM, Ingo Molnar wrote:
>>>
>>> * Stephane Eranian <eranian@google.com> wrote:
>>>
>>>>>> Most of the codes without comments are hardware specific codes.
>>>>>> The corresponding contents in Intel uncore documents are big
>>>>>> tables/lists, nothing tricky/interesting. I really don't know how
>>>>>> to comment these code.
>>>>>
>>>>> Have a look at other PMU drivers, such as
>>>>> arch/x86/kernel/cpu/perf_event_intel_rapl.c, which begin with a
>>>>> general explanation attached below.
>>>>
>>>> I think a more useful modularization would be to split that huge
>>>> file (perf_event_intel_uncore.c) into smaller files like we do for
>>>> the core PMU. There is just too much stuff in this file for my own
>>>> taste. Hard to navigate and I spend quite some time looking at it
>>>> and modifying it!
>>>>
>>>> You could follow the model of the core PMU support files.
>>>> You'd have a "core" file with the common routines, and then
>>>> a file perf processor:
>>>> - perf_event_intel_uncore.c
>>>> - perf_event_intel_snbep_uncore.c
>>>> - perf_event_intel_nhmex_uncore.c
>>>> - perf_event_intel_ivt_uncore.c
>>>> - ...
>>>>
>>>> Each processor specific module, would be a kernel module. The core
>>>> could be one too. Note that this would not alleviate the need for
>>>> some basic descriptions at the beginning of each file outlining the
>>>> PMU boxes exported to a minimum.
>>
>> Most of hardware specific codes in the Intel uncore driver are for SandyBridge/IvyBridge/Haswell. Uncore subsystem in these CPUs are similar. One module per CPU type means we have to duplicate lots of code. I don't think it's a good idea.
>>
> Then, at least split nhm_ex from the rest. It is very big.
Ok, will do.
Regards
Yan, Zheng
>>
>>>
>>> This structure you outline sounds like a good first step, I like it.
>>>
>>> To simplify this restructuring, initially we could even keep the core
>>> uncore bits in the core (ha!), to not have module-on-module
>>> dependencies.
>>>
>>> Thanks,
>>>
>>> Ingo
>>>
>>
next prev parent reply other threads:[~2014-04-24 10:38 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-20 6:03 [PATCH v2 4/4] perf/x86/uncore: modularize Intel uncore driver Yan, Zheng
2014-03-20 8:27 ` Peter Zijlstra
2014-04-18 10:53 ` Ingo Molnar
2014-04-18 16:49 ` Andi Kleen
2014-04-21 2:18 ` Yan, Zheng
2014-04-22 11:35 ` Ingo Molnar
2014-04-23 14:55 ` Stephane Eranian
2014-04-24 8:14 ` Ingo Molnar
2014-04-24 10:25 ` Yan, Zheng
2014-04-24 10:36 ` Stephane Eranian
2014-04-24 10:37 ` Yan, Zheng [this message]
2014-04-24 11:27 ` Peter Zijlstra
2014-04-25 13:17 ` Yan, Zheng
2014-04-25 13:55 ` Peter Zijlstra
2014-04-25 14:06 ` Yan, Zheng
2014-04-25 14:35 ` Peter Zijlstra
2014-04-25 14:44 ` Yan, Zheng
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=5358E982.4030106@intel.com \
--to=zheng.z.yan@intel.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@infradead.org \
--cc=andi@firstfloor.org \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
/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