Re: [PATCH v3 15/21] sched/cache: Disable cache aware scheduling for processes with high thread counts

From: Tim Chen

Date: Thu Feb 19 2026 - 16:11:07 EST


On Thu, 2026-02-19 at 17:50 +0100, Peter Zijlstra wrote:
> On Tue, Feb 10, 2026 at 02:18:55PM -0800, Tim Chen wrote:
>
> > +static bool exceed_llc_nr(struct mm_struct *mm, int cpu)
> > +{
> > + int smt_nr = 1;
> > +
> > +#ifdef CONFIG_SCHED_SMT
> > + if (sched_smt_active())
> > + smt_nr = cpumask_weight(cpu_smt_mask(cpu));
>
> cpu_smt_num_threads ?

Yes, cpu_smt_num_threads should work.

Tim

>
> > +#endif
> > +
> > + return !fits_capacity((mm->sc_stat.nr_running_avg * smt_nr),
> > + per_cpu(sd_llc_size, cpu));
> > +}