[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c63f1825-bea8-b59c-20fe-e5717aae15c7@iogearbox.net>
Date: Thu, 16 Jul 2020 21:02:55 +0200
From: Daniel Borkmann <daniel@...earbox.net>
To: Stanislav Fomichev <sdf@...gle.com>, netdev@...r.kernel.org,
bpf@...r.kernel.org
Cc: davem@...emloft.net, ast@...nel.org,
Andrii Nakryiko <andriin@...com>
Subject: Re: [PATCH bpf-next] selftests/bpf: fix possible hang in
sockopt_inherit
On 7/16/20 12:41 AM, Stanislav Fomichev wrote:
> 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 <andriin@...com>
> Signed-off-by: Stanislav Fomichev <sdf@...gle.com>
Applied, thanks!
Powered by blists - more mailing lists