mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chen, Yu C" <yu.c.chen@intel.com>
To: "Reinette Chatre" <reinette.chatre@intel.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Tony Luck <tony.luck@intel.com>, <x86@kernel.org>,
	Dave Martin <Dave.Martin@arm.com>,
	James Morse <james.morse@arm.com>,
	Babu Moger <babu.moger@amd.com>,
	LKML <linux-kernel@vger.kernel.org>,
	<linux-kselftest@vger.kernel.org>,
	Hongyu Ning <hongyu.ning@linux.intel.com>
Subject: Re: [PATCH] selftests/resctrl: Allow CAT testing when no exclusive cache exists
Date: Wed, 27 May 2026 09:57:16 +0800	[thread overview]
Message-ID: <a5473762-fbd8-4aa9-85ae-8bc8108e1d3c@intel.com> (raw)
In-Reply-To: <3fbb001e-bc78-45d6-92fc-4a8dcf708c58@intel.com>

Hi Reinette,

On 5/26/2026 11:25 PM, Reinette Chatre wrote:
> Hi Chenyu,
> 
> On 5/25/26 4:59 AM, Chen, Yu C wrote:
>> Hi Ilpo,
>>
>> On 5/25/2026 6:01 PM, Ilpo Järvinen wrote:
>>> On Sat, 23 May 2026, Chen Yu wrote:
>>>
>>>> The shareable_bits indicates which cache portions might be shared with
>>>> other agents (e.g., GPU, other I/O devices). On some platforms, all L3
>>>> cache ways are marked as potentially shared.
>>>>
>>>> The L3_CAT test should fall back to using the full CBM mask when no
>>>> exclusive portion exists, since the test logic (writing different
>>>> schemata and measuring cache misses) still works. The shareable mask
> 
> How do you define "still works"? Allowing more interference will impact the
> number of cache misses that is used to determine effectiveness of cache
> allocation, no?
> 
>>>> is a hint about potential interference, not a hard exclusion.
>>>>
>>>> Reported-by: Hongyu Ning <hongyu.ning@linux.intel.com>
>>>> Signed-off-by: Chen Yu <yu.c.chen@intel.com>
>>>> ---
>>>>    tools/testing/selftests/resctrl/cat_test.c | 2 +-
>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/tools/testing/selftests/resctrl/cat_test.c b/tools/testing/selftests/resctrl/cat_test.c
>>>> index f00b622c1460..b6994ba4504b 100644
>>>> --- a/tools/testing/selftests/resctrl/cat_test.c
>>>> +++ b/tools/testing/selftests/resctrl/cat_test.c
>>>> @@ -248,7 +248,7 @@ static int cat_run_test(const struct resctrl_test *test, const struct user_param
>>>>        /* Get the largest contiguous exclusive portion of the cache */
>>>>        ret = get_mask_no_shareable(test->resource, &long_mask);
>>>>        if (ret)
>>>> -        return ret;
>>>> +        long_mask = full_cache_mask;
>>>
>>> Wouldn't it warrant to log something when the fallback occurs? It
>>> certainly looks something that makes the results less reliable (so it
>>> would be nice to know about it when looking at the test results).
>>>
>>
>> Got it. Let me add the following message:
>> ksft_print_msg("No exclusive cache portion found, fall back to full cache mask\n");
> 
> Allowing more interference will cause the test to fail while the system behaves correctly.
> This log message may help a knowledgeable user running the test manually but I expect would
> be confusing to folks not familiar with resctrl and definitely does not help test automation
> that just looks for the pass/fail.
> 
> The test can be fixed by skipping the test, instead of failing, if there are no bits
> available for the test to run as intended. Of course, this will prevent CAT mechanics to
> be tested on this platform so to test CAT on this platform there is a need a new functional
> test since a performance test is not appropriate.
> 

Got it.

My thinking was that shareable_bits only describes portions that may
be shared with non-CPU agents, and on an otherwise idle test system
the CAT miss-rate trend can still be observed even if all ways are
marked shareable. But I agree that this is not a good assumption for
kselftest pass/fail.

So I agree that falling back to the full CBM is not the right fix for
this test. I will change the patch to skip L3_CAT when no exclusive
cache portion is available, with a message explaining that the performance
test cannot run reliably because all cache portions are shareable.

For platforms where all cache ways are marked shareable, do you think
providing a extra parameter to ask cat_test to "ignore" the share
restriction is acceptable?

thanks,
Chenyu

  reply	other threads:[~2026-05-27  1:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-23 10:17 Chen Yu
2026-05-25 10:01 ` Ilpo Järvinen
2026-05-25 11:59   ` Chen, Yu C
2026-05-26 15:25     ` Reinette Chatre
2026-05-27  1:57       ` Chen, Yu C [this message]
2026-05-27  2:24         ` Reinette Chatre
2026-05-27  4:52           ` Chen, Yu C
2026-05-27  9:49           ` Ilpo Järvinen

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=a5473762-fbd8-4aa9-85ae-8bc8108e1d3c@intel.com \
    --to=yu.c.chen@intel.com \
    --cc=Dave.Martin@arm.com \
    --cc=babu.moger@amd.com \
    --cc=hongyu.ning@linux.intel.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=james.morse@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=reinette.chatre@intel.com \
    --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®