public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>,
	Fenghua Yu <fenghua.yu@intel.com>, Shuah Khan <shuah@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH 2/5] selftests/resctrl: Clear unused common codes called by CAT/MBA tests
Date: Thu, 22 Sep 2022 10:44:49 -0700	[thread overview]
Message-ID: <56578d75-d5e9-a4e4-b1ee-a4dbecc167dc@intel.com> (raw)
In-Reply-To: <20220914015147.3071025-4-tan.shaopeng@jp.fujitsu.com>

Hi Shaopeng,

On 9/13/2022 6:51 PM, Shaopeng Tan wrote:
> In CAT/MBA(allocation) tests, function write_schemata() is used to
> change the percentage of schemata.
> In CMT/MBM(monitoring) tests schemata only need to be set 100% once,
> and the default value of schemata is 100% which is set by executing
> mount/umout resctrl filesystem.
> In addition, write_schemata() was not currently called from CMT.

While this is all accurate it is not clear to me that this
justifies the removal of the support for changing the
schemata as part of a CMT test. 

From what I can tell write_schemata() is a a generic function that
currently supports all possible tests. If a later update needs to use
this for a CMT test then it should work.

I do not see any harm in leaving these checks.

> 
> Clean up unused CMT-related processing in function write_schemata().
> 
> Signed-off-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
> ---
>  tools/testing/selftests/resctrl/resctrlfs.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/testing/selftests/resctrl/resctrlfs.c b/tools/testing/selftests/resctrl/resctrlfs.c
> index 6f543e470ad4..349dce00472f 100644
> --- a/tools/testing/selftests/resctrl/resctrlfs.c
> +++ b/tools/testing/selftests/resctrl/resctrlfs.c
> @@ -498,8 +498,7 @@ int write_schemata(char *ctrlgrp, char *schemata, int cpu_no, char *resctrl_val)
>  	FILE *fp;
>  
>  	if (strncmp(resctrl_val, MBA_STR, sizeof(MBA_STR)) &&
> -	    strncmp(resctrl_val, CAT_STR, sizeof(CAT_STR)) &&
> -	    strncmp(resctrl_val, CMT_STR, sizeof(CMT_STR)))
> +	    strncmp(resctrl_val, CAT_STR, sizeof(CAT_STR)))
>  		return -ENOENT;
>  
>  	if (!schemata) {
> @@ -520,8 +519,7 @@ int write_schemata(char *ctrlgrp, char *schemata, int cpu_no, char *resctrl_val)
>  	else
>  		sprintf(controlgroup, "%s/schemata", RESCTRL_PATH);
>  
> -	if (!strncmp(resctrl_val, CAT_STR, sizeof(CAT_STR)) ||
> -	    !strncmp(resctrl_val, CMT_STR, sizeof(CMT_STR)))
> +	if (!strncmp(resctrl_val, CAT_STR, sizeof(CAT_STR)))
>  		sprintf(schema, "%s%d%c%s", "L3:", resource_id, '=', schemata);
>  	if (!strncmp(resctrl_val, MBA_STR, sizeof(MBA_STR)))
>  		sprintf(schema, "%s%d%c%s", "MB:", resource_id, '=', schemata);

Reinette

  reply	other threads:[~2022-09-22 17:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14  1:51 [PATCH 0/5] selftests/resctrl: Some improvements of resctrl selftest Shaopeng Tan
2022-09-14  1:51 ` [PATCH 1/5] selftests/resctrl: Clear unused initalization code in MBM tests Shaopeng Tan
2022-09-22 17:44   ` Reinette Chatre
2022-09-27  9:01     ` tan.shaopeng
2022-09-28 15:48       ` Reinette Chatre
2022-09-29  5:28         ` tan.shaopeng
2022-09-29 15:27           ` Reinette Chatre
2022-09-14  1:51 ` [PATCH] selftests/resctrl: Return MBA check result and make it to output message Shaopeng Tan
2022-09-22 17:51   ` Reinette Chatre
2022-09-27  8:55     ` tan.shaopeng
2022-09-14  1:51 ` [PATCH 2/5] selftests/resctrl: Clear unused common codes called by CAT/MBA tests Shaopeng Tan
2022-09-22 17:44   ` Reinette Chatre [this message]
2022-09-27  9:01     ` tan.shaopeng
2022-09-14  1:51 ` [PATCH 3/5] selftests/resctrl: Remove duplicate codes that clear each test result file Shaopeng Tan
2022-09-22 17:46   ` Reinette Chatre
2022-09-27  9:01     ` tan.shaopeng
2022-09-28 15:48       ` Reinette Chatre
2022-09-29  5:28         ` tan.shaopeng
2022-09-29 15:28           ` Reinette Chatre
2022-09-14  1:51 ` [PATCH 4/5] selftests/resctrl: Kill the child process before exiting the parent process if an exception occurs Shaopeng Tan
2022-09-22 17:47   ` Reinette Chatre
2022-09-27  9:02     ` tan.shaopeng
2022-09-14  1:51 ` [PATCH 5/5] selftests/resctrl: Flush stdout file buffer before executing fork() Shaopeng Tan
2022-09-22 17:52   ` Reinette Chatre

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=56578d75-d5e9-a4e4-b1ee-a4dbecc167dc@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=fenghua.yu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=tan.shaopeng@jp.fujitsu.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