On 17/11/21(Wed) 09:51, Scott Cheloha wrote: > > On Nov 17, 2021, at 03:22, Martin Pieuchot <[email protected]> wrote: > > > > On 16/11/21(Tue) 13:55, Visa Hankala wrote: > >> Currently, dopselect() and doppoll() call tsleep_nsec() without retry. > >> cheloha@ asked if the functions should handle spurious wakeups. I guess > >> such wakeups are unlikely with the nowake wait channel, but I am not > >> sure if that is a safe guess. > > > > I'm not sure to understand, are we afraid a thread sleeping on `nowake' > > can be awaken? Is it the assumption here? > > Yes, but I don't know how.
Then I'd suggest we start with understanding how this can happen otherwise I fear we are adding more complexity for reasons we don't understands. > kettenis@ said spurious wakeups were > possible on a similar loop in sigsuspend(2) > so I mentioned this to visa@ off-list. I don't understand how this can happen. > If we added an assert to panic in wakeup(9) > if the channel is &nowake, would that be > sufficient? I guess so. > Ideally if you sleep on &nowake you should > never get a zero status from the sleep > functions. It should be impossible… if that > is possible to ensure.
