]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Allows per-cpu maps and map-in-map in sleepable programs
authorAlexei Starovoitov <ast@kernel.org>
Wed, 10 Feb 2021 03:36:33 +0000 (19:36 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 11 Feb 2021 15:19:26 +0000 (16:19 +0100)
commitb86daae0fe64b62cc563acf537255c4ba9df99d8
tree38d2be95b066239f129046a77169fe64bb43925d
parent0943fce90e13f36f6e71ae9c0e1b9ee242846417
bpf: Allows per-cpu maps and map-in-map in sleepable programs

Since sleepable programs are now executing under migrate_disable
the per-cpu maps are safe to use.
The map-in-map were ok to use in sleepable from the time sleepable
progs were introduced.

Note that non-preallocated maps are still not safe, since there is
no rcu_read_lock yet in sleepable programs and dynamically allocated
map elements are relying on rcu protection. The sleepable programs
have rcu_read_lock_trace instead. That limitation will be addresses
in the future.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: KP Singh <kpsingh@kernel.org>
Link: https://lore.kernel.org/bpf/20210210033634.62081-9-alexei.starovoitov@gmail.com
kernel/bpf/hashtab.c
kernel/bpf/verifier.c