Re: [PATCH] sparc: populate sysfs cache topology information on sun4v

From: Jan Engelhardt

Date: Thu Oct 22 2026 - 12:23:26 EST



On Monday 2026-10-19 11:49, Stian Halseth wrote:
>Hi Jan, thanks for looking into this!
>
>On Mon, 2026-10-19 at 00:27 +0200, Jan Engelhardt wrote:
>> +int init_cache_level(unsigned int cpu)
>> +{
>> + struct cpu_cacheinfo *i = get_cpu_cacheinfo(cpu);
>> + i->num_levels = 2;
>> + i->num_leaves = 3;
>
>Using the MD node as the cache id with CACHE_ID set looks to me like
>the right way to do it. I tried it on my T4-1 and V240 and have a few
>comments.

I did not even expect this to do anything sensible on V240.
That is just an accident - and multicore-per-package (MC)
sun4u are expected to be still misreported. That needs again
different logic.

>Maybe it's simpler to just walk the MD directly in init_cache_level()
>and populate_cache_leaves(), following the same arcs as
>fill_in_one_cpu(), and add one leaf per cache node?

After some pondering and in anticipation of MC sun4u, I think
re-walking is sensible. I expect there to be a few savings
(just 24 per strand) and a bunch of LOC removals.

More later.