bpf: Skip rcu_barrier() if rcu_trace_implies_rcu_gp() is true
authorHou Tao <houtao1@huawei.com>
Fri, 9 Dec 2022 01:09:47 +0000 (09:09 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 9 Dec 2022 01:50:17 +0000 (17:50 -0800)
commit822ed78fab13d5a54f8b8c030e8c5dc0fcd2cdae
tree8715fbbde0c80e21ce62e7b1e4e71ca279f37e35
parent0893d6007db5cf397f3fc92b2a6935c3ed0c6f00
bpf: Skip rcu_barrier() if rcu_trace_implies_rcu_gp() is true

If there are pending rcu callback, free_mem_alloc() will use
rcu_barrier_tasks_trace() and rcu_barrier() to wait for the pending
__free_rcu_tasks_trace() and __free_rcu() callback.

If rcu_trace_implies_rcu_gp() is true, there will be no pending
__free_rcu(), so it will be OK to skip rcu_barrier() as well.

Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20221209010947.3130477-3-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/memalloc.c