]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/bpf: Test concurrent task local data key creation
authorAmery Hung <ameryhung@gmail.com>
Wed, 30 Jul 2025 18:58:55 +0000 (11:58 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 2 Aug 2025 01:00:46 +0000 (18:00 -0700)
commit784181141782204f6dbbeadf01780e81da5fcb29
treec2bbab91c80e6066923f1b4ce54676091b88d2aa
parent120f1a950e495d9751fdb5c8b7852d94546dcd03
selftests/bpf: Test concurrent task local data key creation

Test thread-safety of tld_create_key(). Since tld_create_key() does
not rely on locks but memory barriers and atomic operations to protect
the shared metadata, the thread-safety of the function is non-trivial.
Make sure concurrent tld_key_create(), both valid and invalid, can not
race and corrupt metatada, which may leads to TLDs not being thread-
specific or duplicate TLDs with the same name.

Signed-off-by: Amery Hung <ameryhung@gmail.com>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Link: https://lore.kernel.org/r/20250730185903.3574598-5-ameryhung@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/test_task_local_data.c