linux/tools/testing
David Vernet 1b403ce77d bpf: Remove bpf_cpumask_kptr_get() kfunc
Now that struct bpf_cpumask is RCU safe, there's no need for this kfunc.
Rather than doing the following:

private(MASK) static struct bpf_cpumask __kptr *global;

int BPF_PROG(prog, s32 cpu, ...)
{
	struct bpf_cpumask *cpumask;

	bpf_rcu_read_lock();
	cpumask = bpf_cpumask_kptr_get(&global);
	if (!cpumask) {
		bpf_rcu_read_unlock();
		return -1;
	}
	bpf_cpumask_setall(cpumask);
	...
	bpf_cpumask_release(cpumask);
	bpf_rcu_read_unlock();
}

Programs can instead simply do (assume same global cpumask):

int BPF_PROG(prog, ...)
{
	struct bpf_cpumask *cpumask;

	bpf_rcu_read_lock();
	cpumask = global;
	if (!cpumask) {
		bpf_rcu_read_unlock();
		return -1;
	}
	bpf_cpumask_setall(cpumask);
	...
	bpf_rcu_read_unlock();
}

In other words, no extra atomic acquire / release, and less boilerplate
code.

This patch removes both the kfunc, as well as its selftests and
documentation.

Signed-off-by: David Vernet <void@manifault.com>
Link: https://lore.kernel.org/r/20230316054028.88924-5-void@manifault.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-03-16 12:28:30 -07:00
..
crypto/chacha20-s390
cxl Merge branch 'for-6.3/cxl-rr-emu' into cxl/next 2023-02-14 16:06:10 -08:00
fault-injection
ktest ktest: Restore stty setting at first in dodie 2023-02-20 11:52:27 -05:00
kunit kunit: kunit.py extract handlers 2023-02-08 14:25:30 -07:00
memblock Revert "mm: Always release pages to the buddy allocator in memblock_free_late()." 2023-02-07 13:07:37 +02:00
nvdimm libnvdimm: Introduce CONFIG_NVDIMM_SECURITY_TEST flag 2022-12-01 12:42:35 -08:00
radix-tree maple_tree: remove the parameter entry of mas_preallocate 2023-02-02 22:32:52 -08:00
scatterlist
selftests bpf: Remove bpf_cpumask_kptr_get() kfunc 2023-03-16 12:28:30 -07:00
vsock test/vsock: vsock_perf utility 2023-01-12 12:53:54 +01:00