bpf: Always use raw spinlock for hash bucket lock
authorHou Tao <houtao1@huawei.com>
Wed, 21 Sep 2022 07:38:26 +0000 (15:38 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 22 Sep 2022 01:08:54 +0000 (18:08 -0700)
commit1d8b82c613297f24354b4d750413a7456b5cd92c
tree215d668304cfd232550951da4cb0362813cfde53
parent05b24ff9b2cfabfcfd951daaa915a036ab53c9e1
bpf: Always use raw spinlock for hash bucket lock

For a non-preallocated hash map on RT kernel, regular spinlock instead
of raw spinlock is used for bucket lock. The reason is that on RT kernel
memory allocation is forbidden under atomic context and regular spinlock
is sleepable under RT.

Now hash map has been fully converted to use bpf_map_alloc, and there
will be no synchronous memory allocation for non-preallocated hash map,
so it is safe to always use raw spinlock for bucket lock on RT. So
removing the usage of htab_use_raw_lock() and updating the comments
accordingly.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20220921073826.2365800-1-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/hashtab.c