diff options
| author | Stanislav Fomichev <[email protected]> | 2020-07-15 22:41:07 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2020-07-16 18:57:09 +0000 |
| commit | e81e7a533742c30615f8b15390df6525cef96778 (patch) | |
| tree | ecf1d3c7989e38766aab4b931daefdd8062d833c /scripts/bpf_helpers_doc.py | |
| parent | bpf: revert "test_bpf: Flag tests that cannot be jited on s390" (diff) | |
| download | kernel-e81e7a533742c30615f8b15390df6525cef96778.tar.gz kernel-e81e7a533742c30615f8b15390df6525cef96778.zip | |
selftests/bpf: Fix possible hang in sockopt_inherit
Andrii reported that sockopt_inherit occasionally hangs up on 5.5 kernel [0].
This can happen if server_thread runs faster than the main thread.
In that case, pthread_cond_wait will wait forever because
pthread_cond_signal was executed before the main thread was blocking.
Let's move pthread_mutex_lock up a bit to make sure server_thread
runs strictly after the main thread goes to sleep.
(Not sure why this is 5.5 specific, maybe scheduling is less
deterministic? But I was able to confirm that it does indeed
happen in a VM.)
[0] https://lore.kernel.org/bpf/CAEf4BzY0-bVNHmCkMFPgObs=isUAyg-dFzGDY7QWYkmm7rmTSg@mail.gmail.com/
Reported-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Stanislav Fomichev <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'scripts/bpf_helpers_doc.py')
0 files changed, 0 insertions, 0 deletions
