public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Andrea Righi <arighi@nvidia.com>
Cc: David Vernet <void@manifault.com>,
	Changwoo Min <changwoo@igalia.com>,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/6] sched_ext: idle: Introduce the concept of allowed CPUs
Date: Mon, 10 Mar 2025 06:07:21 -1000	[thread overview]
Message-ID: <Z88OOena_fucXLVl@slm.duckdns.org> (raw)
In-Reply-To: <Z822PGZLYl1Vima4@gpd3>

Hello,

On Sun, Mar 09, 2025 at 04:39:40PM +0100, Andrea Righi wrote:
> > Would just using a pre-allocated cpumask to do pre-and on @cpus_allowed
> > work? This won't only be used for topology support (e.g. soft partitioning
> > in scx_layered and scx_mitosis may want to use multi-topology-unit spanning
> > subsets) and I'm not sure assuming and optimizing for that is a good idea
> > for generic API.
> 
> We can pre-allocate two additional (per-cpu) cpumasks to do:
>  - cpumask_and(numa_cpus, numa_span(cpu), cpus_allowed)
>  - cpumask_and(llc_cpus, llc_span(cpu), cpus_allowed)
> 
> And update/use them only when it's needed. In this way the API would be
> generic without making any implicit assumption about @cpus_allowed.

I'm not quite following why two masks would be necessary. The user is
providing two masks and and'ing those two masks result in a single
cpus_allowed mask which can then be passed down to the existing pick
functions, no?

Thanks.

-- 
tejun

  reply	other threads:[~2025-03-10 16:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-07 20:01 [PATCHSET v2 sched_ext/for-6.15] sched_ext: Enhance built-in idle selection with allowed CPUs Andrea Righi
2025-03-07 20:01 ` [PATCH 1/6] sched_ext: idle: Honor idle flags in the built-in idle selection policy Andrea Righi
2025-03-07 20:01 ` [PATCH 2/6] sched_ext: idle: Refactor scx_select_cpu_dfl() Andrea Righi
2025-03-07 20:01 ` [PATCH 3/6] sched_ext: idle: Introduce the concept of allowed CPUs Andrea Righi
2025-03-07 22:17   ` Tejun Heo
2025-03-08  6:48     ` Andrea Righi
2025-03-09 14:56       ` Tejun Heo
2025-03-09 15:39         ` Andrea Righi
2025-03-10 16:07           ` Tejun Heo [this message]
2025-03-10 17:15             ` Andrea Righi
2025-03-07 20:01 ` [PATCH 4/6] sched_ext: idle: Introduce scx_bpf_select_cpu_and() Andrea Righi
2025-03-07 20:01 ` [PATCH 5/6] selftests/sched_ext: Add test for scx_bpf_select_cpu_and() Andrea Righi
2025-03-07 20:01 ` [PATCH 6/6] sched_ext: idle: Deprecate scx_bpf_select_cpu_dfl() Andrea Righi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z88OOena_fucXLVl@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=bpf@vger.kernel.org \
    --cc=changwoo@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=void@manifault.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox