linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>,
	shuah@kernel.org, linux-kselftest@vger.kernel.org
Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	tony.luck@intel.com, babu.moger@amd.com, james.morse@arm.com,
	ravi.v.shankar@intel.com, fenghua.yu@intel.com, x86@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V1 10/13] selftests/resctrl: Change Cache Allocation Technology (CAT) test
Date: Wed, 11 Mar 2020 10:03:08 -0700	[thread overview]
Message-ID: <e22014e5-8ffc-7966-b260-a0665f771ee2@intel.com> (raw)
In-Reply-To: <8645c93547ae6c4e35633dbb09d9355219d9e3b2.camel@intel.com>

Hi Sai,

On 3/10/2020 6:59 PM, Sai Praneeth Prakhya wrote:
> On Tue, 2020-03-10 at 15:14 -0700, Reinette Chatre wrote:
>> Hi Sai,
>>
>> Not just specific to this patch but I think the prevalent use of global
>> variables that are initialized/used or allocated/released from a variety
>> of places within the code is creating traps. I seemed to have stumbled
>> on a few during this review so far but it is hard to keep track of and I
>> am not confident that I caught them all. Having the code be symmetrical
>> (allocate and free from same area or initialize and use from same area)
>> does help to avoid such complexity.
> 
> Sure! makes sense. I will try to wrap them up in some meaningful structures to
> pass around functions and will see if everything still works as expected. If
> not, I will comment why a particular variable needs to be global.
> 
>> This patch and the patch that follows are both quite large and difficult
>> to keep track of all the collected changes. There seems to be
>> opportunity for separating it into logical changes. Some of my comments
>> may be just because I could not keep track of all that is changed at the
>> same time.
> 
> Ok.. makes sense. The main reason this patch and the next patch are large 
> because they do two things
> 1. Remove previous CAT/CQM test case
> 2. Add new CAT/CQM test cases
> 
> Since the new test cases are not just logical extensions or fixing some bugs
> in previous test cases, the patch might not be readable. I am thinking to
> split this at-least like this
> 1. A patch to remove CAT test case
> 2. A patch to remove CQM test case
> 3. Patches that just add CAT and CQM (without other changes)
> 
> Please let me know if you think otherwise

I think this patch can be split up into logical changes without breaking
the tests along the way. In my original review I identified two changes
that can be split out. Other things that can be split out:
- have CAT test take shareable bits into account
- enable measurement of cache references (addition of this new perf
event attribute, hooks to get measurements, etc.)
- transition CAT test to use "perf rate" measurement instead of "perf count"
- etc.


> 
>> On 3/6/2020 7:40 PM, Sai Praneeth Prakhya wrote:

[SNIP]

>>> -static struct perf_event_attr pea_llc_miss;
>>> +static struct perf_event_attr pea_llc_miss, pea_llc_access;
>>>  static struct read_format rf_cqm;
>>> -static int fd_lm;
>>> +static int fd_lm, fd_la;
>>>  char llc_occup_path[1024];
>>>  
>>>  static void initialize_perf_event_attr(void)
>>> @@ -27,15 +27,30 @@ static void initialize_perf_event_attr(void)
>>>  	pea_llc_miss.inherit = 1;
>>>  	pea_llc_miss.exclude_guest = 1;
>>>  	pea_llc_miss.disabled = 1;
>>> +
>>> +	pea_llc_access.type = PERF_TYPE_HARDWARE;
>>> +	pea_llc_access.size = sizeof(struct perf_event_attr);
>>> +	pea_llc_access.read_format = PERF_FORMAT_GROUP;
>>> +	pea_llc_access.exclude_kernel = 1;
>>> +	pea_llc_access.exclude_hv = 1;
>>> +	pea_llc_access.exclude_idle = 1;
>>> +	pea_llc_access.exclude_callchain_kernel = 1;
>>> +	pea_llc_access.inherit = 1;
>>> +	pea_llc_access.exclude_guest = 1;
>>> +	pea_llc_access.disabled = 1;
>>> +
>>
>> This initialization appears to duplicate the initialization done above.
>> Perhaps this function could be a wrapper that calls an initialization
>> function with pointer to perf_event_attr that initializes structure the
>> same?
> 
> I did think about a wrapper but since pea_llc_access and pea_llc_miss are
> global variables, I thought passing them as variables might not look good (why
> do we want to pass a global variable?). I will try and see if I can make these
> local variables.

My goal was to avoid the duplicated code to initialize them identically.
It is not clear to me why you think that would not look good. Perhaps I
have not thought it through correctly ...

Reinette



  reply	other threads:[~2020-03-11 17:04 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-07  3:40 [PATCH V1 00/13] Miscellaneous fixes for resctrl selftests Sai Praneeth Prakhya
2020-03-07  3:40 ` [PATCH V1 01/13] selftests/resctrl: Fix feature detection Sai Praneeth Prakhya
2020-03-09 21:44   ` Reinette Chatre
2020-03-09 22:22     ` Prakhya, Sai Praneeth
2020-03-09 22:33       ` Reinette Chatre
2020-03-09 22:51         ` Prakhya, Sai Praneeth
2020-03-11 18:06           ` Reinette Chatre
2020-03-11 18:22             ` Sai Praneeth Prakhya
2020-03-11 18:45               ` Reinette Chatre
2020-03-11 18:54                 ` Sai Praneeth Prakhya
2020-03-07  3:40 ` [PATCH V1 02/13] selftests/resctrl: Fix typo Sai Praneeth Prakhya
2020-03-07  3:40 ` [PATCH V1 03/13] selftests/resctrl: Fix typo in help text Sai Praneeth Prakhya
2020-03-07  3:40 ` [PATCH V1 04/13] selftests/resctrl: Ensure sibling CPU is not same as original CPU Sai Praneeth Prakhya
2020-03-07  3:40 ` [PATCH V1 05/13] selftests/resctrl: Fix missing options "-n" and "-p" Sai Praneeth Prakhya
2020-03-07  3:40 ` [PATCH V1 06/13] selftests/resctrl: Fix MBA/MBM results reporting format Sai Praneeth Prakhya
2020-03-07  3:40 ` [PATCH V1 07/13] selftests/resctrl: Don't use variable argument list for setup function Sai Praneeth Prakhya
2020-03-07  3:40 ` [PATCH V1 08/13] selftests/resctrl: Fix typos Sai Praneeth Prakhya
2020-03-07  3:40 ` [PATCH V1 09/13] selftests/resctrl: Modularize fill_buf for new CAT test case Sai Praneeth Prakhya
2020-03-10 21:59   ` Reinette Chatre
2020-03-11  1:04     ` Sai Praneeth Prakhya
2020-03-11 15:44       ` Reinette Chatre
2020-03-11 17:45         ` Sai Praneeth Prakhya
2020-03-11 18:10           ` Reinette Chatre
2020-03-11 18:14             ` Sai Praneeth Prakhya
2020-03-07  3:40 ` [PATCH V1 10/13] selftests/resctrl: Change Cache Allocation Technology (CAT) test Sai Praneeth Prakhya
2020-03-10 22:14   ` Reinette Chatre
2020-03-11  1:59     ` Sai Praneeth Prakhya
2020-03-11 17:03       ` Reinette Chatre [this message]
2020-03-11 19:14         ` Sai Praneeth Prakhya
2020-03-11 20:22           ` Reinette Chatre
2020-03-11 20:55             ` Sai Praneeth Prakhya
2020-03-07  3:40 ` [PATCH V1 11/13] selftests/resctrl: Change Cache Quality Monitoring (CQM) test Sai Praneeth Prakhya
2020-03-10 22:18   ` Reinette Chatre
2020-03-11  2:46     ` Sai Praneeth Prakhya
2020-03-11 17:19       ` Reinette Chatre
2020-03-11 17:33         ` Sai Praneeth Prakhya
2020-03-11 18:03           ` Reinette Chatre
2020-03-11 18:07             ` Sai Praneeth Prakhya
2020-03-07  3:40 ` [PATCH V1 12/13] selftests/resctrl: Dynamically select buffer size for CAT test Sai Praneeth Prakhya
2020-03-10 22:19   ` Reinette Chatre
2020-03-11  2:52     ` Sai Praneeth Prakhya
2020-03-07  3:40 ` [PATCH V1 13/13] selftests/resctrl: Cleanup fill_buff after changing " Sai Praneeth Prakhya

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=e22014e5-8ffc-7966-b260-a0665f771ee2@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=babu.moger@amd.com \
    --cc=bp@alien8.de \
    --cc=fenghua.yu@intel.com \
    --cc=james.morse@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=ravi.v.shankar@intel.com \
    --cc=sai.praneeth.prakhya@intel.com \
    --cc=shuah@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@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;
as well as URLs for NNTP newsgroup(s).