diff options
author | David Vernet <void@manifault.com> | 2023-12-07 22:08:42 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-12-10 06:37:33 +0100 |
commit | a6de18f310a511278c1ff16b96eb2d500eada725 (patch) | |
tree | e3a2a52d95faf82312d1e13f815fc797a4b6bf4a /Documentation/bpf | |
parent | test_bpf: Rename second ALU64_SMOD_X to ALU64_SMOD_K (diff) | |
download | linux-a6de18f310a511278c1ff16b96eb2d500eada725.tar.xz linux-a6de18f310a511278c1ff16b96eb2d500eada725.zip |
bpf: Add bpf_cpumask_weight() kfunc
It can be useful to query how many bits are set in a cpumask. For
example, if you want to perform special logic for the last remaining
core that's set in a mask. Let's therefore add a new
bpf_cpumask_weight() kfunc which checks how many bits are set in a mask.
Signed-off-by: David Vernet <void@manifault.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20231207210843.168466-2-void@manifault.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'Documentation/bpf')
-rw-r--r-- | Documentation/bpf/cpumasks.rst | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/bpf/cpumasks.rst b/Documentation/bpf/cpumasks.rst index a22b6ad105fb..b5d47a04da5d 100644 --- a/Documentation/bpf/cpumasks.rst +++ b/Documentation/bpf/cpumasks.rst @@ -352,7 +352,7 @@ can be used to query the contents of cpumasks. .. kernel-doc:: kernel/bpf/cpumask.c :identifiers: bpf_cpumask_first bpf_cpumask_first_zero bpf_cpumask_first_and - bpf_cpumask_test_cpu + bpf_cpumask_test_cpu bpf_cpumask_weight .. kernel-doc:: kernel/bpf/cpumask.c :identifiers: bpf_cpumask_equal bpf_cpumask_intersects bpf_cpumask_subset |