On 3/6/23 3:54 PM, Kui-Feng Lee wrote:
@@ -646,6 +679,7 @@ const struct bpf_map_ops bpf_struct_ops_map_ops = {
.map_alloc_check = bpf_struct_ops_map_alloc_check,
.map_alloc = bpf_struct_ops_map_alloc,
.map_free = bpf_struct_ops_map_free,
+ .map_free_rcu = bpf_struct_ops_map_free_rcu,
just came to my mind. Instead of having a rcu callback, synchronize_rcu() can
be called in bpf_struct_ops_map_free(). Then the '.map_free_rcu' addition and
its related change is not needed.
synchronize_rcu() probably blocks other subsystem, right?
.map_free is called from system_unbound_wq, so it can block.