Hou Tao <houtao@xxxxxxxxxxxxxxx> writes: > From: Hou Tao <houtao1@xxxxxxxxxx> > > When bpf_timer is used in LRU hash map, calling check_and_free_fields() > in htab_lru_map_delete_node() will invoke bpf_timer_cancel_and_free() to > free the bpf_timer. If the timer is running on other CPUs, > hrtimer_cancel() will invoke hrtimer_cancel_wait_running() to spin on > current CPU to wait for the completion of the hrtimer callback. > > Considering that the deletion has already acquired a raw-spin-lock > (bucket lock). To reduce the time holding the bucket lock, move the > invocation of check_and_free_fields() out of bucket lock. However, > because htab_lru_map_delete_node() is invoked with LRU raw spin lock > being held, the freeing of special fields still happens in a locked > scope. > > Signed-off-by: Hou Tao <houtao1@xxxxxxxxxx> Reviewed-by: Toke Høiland-Jørgensen <toke@xxxxxxxxxx>