]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bpf: Replace bpf_cpumask_any* with bpf_cpumask_any_distribute*
authorDavid Vernet <void@manifault.com>
Sat, 10 Jun 2023 03:50:51 +0000 (22:50 -0500)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 12 Jun 2023 22:09:11 +0000 (15:09 -0700)
commitf983be917332ea5e03f689e12c6668be48cb4cfe
treedfd0162a90c57180c09b56f617f95d952088d9ff
parent58476d8a24bd94b96ac1ab78baba8af1cc89fbeb
bpf: Replace bpf_cpumask_any* with bpf_cpumask_any_distribute*

We currently export the bpf_cpumask_any() and bpf_cpumask_any_and()
kfuncs. Intuitively, one would expect these to choose any CPU in the
cpumask, but what they actually do is alias to cpumask_first() and
cpmkas_first_and().

This is useless given that we already export bpf_cpumask_first() and
bpf_cpumask_first_and(), so this patch replaces them with kfuncs that
call cpumask_any_distribute() and cpumask_any_and_distribute(), which
actually choose any CPU from the cpumask (or the AND of two cpumasks for
the latter).

Signed-off-by: David Vernet <void@manifault.com>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20230610035053.117605-3-void@manifault.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/cpumask.c