Re: [PATCH v2 bpf-next] bpf: use raw_spin_trylock() for pcpu_freelist_push/pop in NMI

2020-10-05 Thread Daniel Borkmann
On 10/5/20 8:03 PM, Martin KaFai Lau wrote: On Mon, Oct 05, 2020 at 09:58:38AM -0700, Song Liu wrote: [...] non-NMI pop(): use _lock(); check per cpu lists first; if all per cpu lists are empty, check extralist; if extralist is empty, return NULL. non-NMI pus

Re: [PATCH v2 bpf-next] bpf: use raw_spin_trylock() for pcpu_freelist_push/pop in NMI

2020-10-05 Thread Martin KaFai Lau
On Mon, Oct 05, 2020 at 09:58:38AM -0700, Song Liu wrote: > Recent improvements in LOCKDEP highlighted a potential A-A deadlock with > pcpu_freelist in NMI: > > ./tools/testing/selftests/bpf/test_progs -t stacktrace_build_id_nmi > > [ 18.984807] > [ 18.984807]

[PATCH v2 bpf-next] bpf: use raw_spin_trylock() for pcpu_freelist_push/pop in NMI

2020-10-05 Thread Song Liu
Recent improvements in LOCKDEP highlighted a potential A-A deadlock with pcpu_freelist in NMI: ./tools/testing/selftests/bpf/test_progs -t stacktrace_build_id_nmi [ 18.984807] [ 18.984807] WARNING: inconsistent lock state [ 18.984808] 5.9.0-rc6-01771-g1466de