[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zyqq9fnsOg56aO7S@slm.duckdns.org>
Date: Tue, 5 Nov 2024 13:32:05 -1000
From: Tejun Heo <tj@...nel.org>
To: Andrea Righi <arighi@...dia.com>
Cc: David Vernet <void@...ifault.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH sched_ext/for-6.13] sched_ext: Do not enable LLC/NUMA
optimizations when domains overlap
Hello, Andrea.
Sorry about the delay.
On Thu, Oct 31, 2024 at 08:34:01AM +0100, Andrea Righi wrote:
> @@ -3154,16 +3154,29 @@ static void update_selcpu_topology(void)
> rcu_read_lock();
> sd = rcu_dereference(per_cpu(sd_llc, cpu));
> if (sd) {
> - cpus = sched_domain_span(sd);
> - if (cpumask_weight(cpus) < num_possible_cpus())
> + llc_cpus = sched_domain_span(sd);
> + if (cpumask_weight(llc_cpus) < num_possible_cpus())
Not from this patch but should the weight be compared against
num_online_cpus()? Sched domains don't include offline CPUs, right?
...
> + /*
> + * If the NUMA domain perfectly overlaps with the LLC domain, enable
> + * LLC optimization only, as checking for an idle CPU in the same
> + * domain twice is redundant.
> + */
> + if (enable_numa && enable_llc && cpumask_equal(numa_cpus, llc_cpus))
> + enable_numa = false;
> + /*
> + * If all the online CPUs are in the same LLC domain, there is no
> + * reason to enable LLC optimization.
> + */
> + if (enable_llc && cpumask_equal(llc_cpus, cpu_online_mask))
> + enable_llc = false;
The second test looks like it should always be correct. I'm not sure the
first one is. It probably is good enough but would at least be worthwhile to
explain why that is?
Thanks.
--
tejun
Powered by blists - more mailing lists