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

From: Peter Zijlstra

Date: Thu Feb 19 2026 - 11:50:54 EST


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 ?

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