On Fri, Aug 23, 2024 at 10:24:57AM GMT, Linus Torvalds wrote: > On Fri, 23 Aug 2024 at 08:37, NeilBrown <neilb@xxxxxxx> wrote: > > > > I would really like to add > > > > wait_var_event_locked(variable, condition, spinlock) > > > > so that above would be one or two lines. > > We don't even have that for the regular wait_event, but we do have > > wait_event_interruptible_locked > wait_event_interruptible_locked_irq > > but they actually only work on the wait-queue lock, not on some > generic "use this lock". > > Honestly, I like your version much better, but having two *very* > different models for what "locked" means looks wrong. > > The wait-queue lock (our current "locked" event version) is a rather > important special case, though, and takes advantage of holding the > waitqueue lock by then using __add_wait_queue_entry_tail() without > locking. > > "You are in a maze of twisty little functions, all alike". "You could've used a little more cowbell^wunderscores." __fput() ____fput() __wait_var_event() ___wait_var_event() https://www.youtube.com/watch?v=cVsQLlk-T0s