mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Horgan <ben.horgan@arm.com>
To: Richard Cheng <icheng@nvidia.com>,
	tony.luck@intel.com, reinette.chatre@intel.com, shuah@kernel.org,
	fenghuay@nvidia.com
Cc: x86@kernel.org, Dave.Martin@arm.com, james.morse@arm.com,
	babu.moger@amd.com, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, kaihengf@nvidia.com,
	kobak@nvidia.com, newtonl@nvidia.com, kristinc@nvidia.com
Subject: Re: [PATCH v6 1/2] selftests/resctrl: Fix CMT test failure when all cache bits are tested
Date: Mon, 16 Nov 2026 16:30:06 +0000	[thread overview]
Message-ID: <6ae02c7b-69a3-43a1-bcd5-639780e2a0f2@arm.com> (raw)
In-Reply-To: <20261114140108.36954-2-icheng@nvidia.com>

Hi Richard,

On 14/11/2026 14:01, Richard Cheng wrote:
> The CMT test accepts any number of bits from 1 to the length of the full
> cache bit mask via "-n". Since cmt_init() gives the default resource
> group the inverse of the tested mask to keep other tasks out of the
> tested cache portion.
> 
> When all bits are tested the inverse mask is empty. resctrl rejects an
> empty mask with "Mask out of range" on systems that require at least one
> bit to be set, cmt_init() fails and the test fails before taking any
> measurement.
> 
> Only write the schemata of the default resource group when there're bits
> left for it. When all bits are tested the default resource group keeps
> its allocation.

Why did you choose this policy? For instance, why not just set a single bit?

Thanks,

Ben

> 
> Fixes: 7a214b4ec1c9 ("selftests/resctrl: Improve accuracy of cache occupancy test")
> Signed-off-by: Richard Cheng <icheng@nvidia.com>
> ---
>  tools/testing/selftests/resctrl/cmt_test.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/testing/selftests/resctrl/cmt_test.c b/tools/testing/selftests/resctrl/cmt_test.c
> index ccb6fe881a94..5d0bb27b7817 100644
> --- a/tools/testing/selftests/resctrl/cmt_test.c
> +++ b/tools/testing/selftests/resctrl/cmt_test.c
> @@ -42,10 +42,13 @@ static int cmt_init(const struct resctrl_test *test,
>  	if (ret)
>  		return ret;
>  
> -	snprintf(schemata, sizeof(schemata), "%lx", ~param->mask & full_mask);
> -	ret = write_schemata("", schemata, uparams->cpu, test->resource);
> -	if (ret)
> -		return ret;
> +	/* No bits are left for the default group when all bits are tested. */
> +	if (~param->mask & full_mask) {
> +		snprintf(schemata, sizeof(schemata), "%lx", ~param->mask & full_mask);
> +		ret = write_schemata("", schemata, uparams->cpu, test->resource);
> +		if (ret)
> +			return ret;
> +	}
>  
>  	snprintf(schemata, sizeof(schemata), "%lx", param->mask);
>  	ret = write_schemata(param->ctrlgrp, schemata, uparams->cpu, test->resource);


  reply	other threads:[~2026-11-16 16:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14 14:01 [PATCH v6 0/2] selftests/resctrl: Check the effect of the CBM in CMT test Richard Cheng
2026-11-14 14:01 ` [PATCH v6 1/2] selftests/resctrl: Fix CMT test failure when all cache bits are tested Richard Cheng
2026-11-16 16:30   ` Ben Horgan [this message]
2026-11-14 14:01 ` [PATCH v6 2/2] selftests/resctrl: Check that CBM limits LLC occupancy in CMT test Richard Cheng

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=6ae02c7b-69a3-43a1-bcd5-639780e2a0f2@arm.com \
    --to=ben.horgan@arm.com \
    --cc=Dave.Martin@arm.com \
    --cc=babu.moger@amd.com \
    --cc=fenghuay@nvidia.com \
    --cc=icheng@nvidia.com \
    --cc=james.morse@arm.com \
    --cc=kaihengf@nvidia.com \
    --cc=kobak@nvidia.com \
    --cc=kristinc@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=newtonl@nvidia.com \
    --cc=reinette.chatre@intel.com \
    --cc=shuah@kernel.org \
    --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

all inboxes | Powered by JetHome®