Re: [PATCH v2 1/4] powerpc/topology: Introduce llc_override kernel parameter

From: Shrikanth Hegde

Date: Tue Nov 10 2026 - 12:43:38 EST


Hi Chen Yu, Thanks for taking a look.

On 10/23/26 9:12 PM, Chen Yu wrote:
Hi Shrikanth,

On Fri, Oct 23, 2026 at 06:46:43PM +0530, Shrikanth Hegde wrote:

[ ... ]

---
arch/powerpc/kernel/smp.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 6a5a5469aaae..6b1201ea3572 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -1059,6 +1059,29 @@ static bool has_coregroup_support(void)
return coregroup_enabled;
}
+enum llc_override_values {
+ LLC_OVERRIDE_MC = 1,
+ LLC_OVERRIDE_PKG = 2,
+};
+
+static int llc_override;
+
+static int __init set_llc_override(char *str)
+{
+ if (!strcasecmp(str, "mc") && has_coregroup_support())
+ WRITE_ONCE(llc_override, LLC_OVERRIDE_MC);

There is only 1 booting CPU at the moment, maybe WRITE_ONCE() is not needed.

Yes.


+ else if (!strcasecmp(str, "pkg"))
+ WRITE_ONCE(llc_override, LLC_OVERRIDE_PKG);
+ else {
+ pr_warn("Unsupported llc_override=%s\n", str);
+ return 1;
+ }
+
+ pr_info("llc_override set at domain: %s\n", str);
+ return 1;
+}
+__setup("llc_override=", set_llc_override);
+
static int __init init_big_cores(void)
{
int cpu;

On PowerPC, it seems that get_effective_llc_bytes() always returns 0,
which makes exceed_llc_capacity() return true, so cache-aware scheduling
is disabled on PowerPC. We might need to provide an arch_llc_bytes() that
is adjusted based on llc_override - sometimes calculate the sum of L2 across
several cores.

thanks,
Chenyu

Ah!. I hadn't checked that. Thanks for pointing out.

I am thinking right path would be to move powerpc cacheinfo into a generic one.
I see there was an effort a while ago. Need to look into how to pull it off
if it is possible.

We could think of arch_llc_bytes if above is not possible.