[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZxgaPqZNtouBcXHa@gpd3>
Date: Tue, 22 Oct 2024 23:33:50 +0200
From: Andrea Righi <arighi@...dia.com>
To: Tejun Heo <tj@...nel.org>
Cc: David Vernet <void@...ifault.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] sched_ext: Introduce LLC awareness to the default
idle selection policy
On Tue, Oct 22, 2024 at 09:11:52AM -1000, Tejun Heo wrote:
> Hello,
>
> On Tue, Oct 22, 2024 at 04:55:51PM +0200, Andrea Righi wrote:
> ...
> > Thinking more about this, we can avoid re-generating the llc_cpus
> > cpumask when the task can run on all CPUs (likely the majority of the
> > cases) and it's probably more efficient to check for
> > cpumask_equal(p->cpus_ptr, cpu_possible_mask) and just use llc_mask in
> > this case.
>
> At the simplest, we can just skip llc-aware idle picking if not all CPUs are
> allowed. Also, it's probably cheaper to test p->nr_cpus_allowed than testing
> cpus_ptr.
That's probably the easiest and most efficient way, at the end if you're
restricting the CPU affinity from user-space, then you can just set the
LLC affinity as well. In this way we can completely get rid of the
cpumask_and() and just use sd->span directly. And rely on
p->nr_cpus_allowed to detect when the task is allowed to run on all
CPUs (and receive the LLC awareness optimization).
>
> > We could also optimize tasks that can only run on 1 CPU, but we never
> > call ops.select_cpu() for them, they're just skipped in
> > select_task_rq(), so I'm not sure if we should handle this special case
> > (maybe I can add a comment, to make it more clear).
>
> Yeah, a comment can be helpful.
Ok, will add a comment.
Thanks,
-Andrea
Powered by blists - more mailing lists