]> git.ipfire.org Git - thirdparty/linux.git/commit
bpf: Remove task local storage percpu counter
authorAmery Hung <ameryhung@gmail.com>
Thu, 5 Feb 2026 22:29:04 +0000 (14:29 -0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Fri, 6 Feb 2026 22:29:09 +0000 (14:29 -0800)
commit4a98c2efa613f0b01bc3aa0acb8c3ff7ae29b6f9
tree6849217c63851cb8a19521bce59957db63de3518
parent8dabe34b9d5b1135b084268396ed2267107e64c1
bpf: Remove task local storage percpu counter

The percpu counter in task local storage is no longer needed as the
underlying bpf_local_storage can now handle deadlock with the help of
rqspinlock. Remove the percpu counter and related migrate_{disable,
enable}.

Since the percpu counter is removed, merge back bpf_task_storage_get()
and bpf_task_storage_get_recur(). This will allow the bpf syscalls and
helpers to run concurrently on the same CPU, removing the spurious
-EBUSY error. bpf_task_storage_get(..., F_CREATE) will now always
succeed with enough free memory unless being called recursively.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Amery Hung <ameryhung@gmail.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20260205222916.1788211-7-ameryhung@gmail.com
kernel/bpf/bpf_task_storage.c
kernel/bpf/helpers.c