Re: [PATCH v3 04/21] sched/cache: Make LLC id continuous
From: Chen, Yu C
Date: Fri Feb 20 2026 - 10:54:26 EST
Hi Peter,
On 2/19/2026 11:40 PM, Peter Zijlstra wrote:
On Mon, Feb 16, 2026 at 01:14:20PM +0530, K Prateek Nayak wrote:
[ ... ]
+static int __sched_domains_alloc_llc_id(void)
+{
+ int lid;
+
+ lockdep_assert_held(&sched_domains_mutex);
+
+ lid = cpumask_first_zero(sched_domains_llc_id_allocmask);
+ if (lid >= tl_max_llcs)
+ tl_max_llcs++;
Urgh,. should we not rather track the max lid?
Do you mean we should not always increment the max lid,
but instead decrease it when an llc_id is released?
I think Tim has adjusted the code to shrink tl_max_llcs
when an llc_id is released:
https://lore.kernel.org/all/acc7a5c96e8235bf11af640798ce1b60bcaa8196.camel@xxxxxxxxxxxxxxx/
Also, we allocate max_llc sized data structures, if this thing is
'variable' we must also always store a copy of the 'lid' size of the
time of allocation.
Do you mean we should save the latest llc_max in the sched_domain
and publish it during sd attachment, as suggested at:
https://lore.kernel.org/all/20260220104533.GO1395266@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
thanks,
Chenyu