]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sched/wait: Add a waitqueue helper for fully exclusive priority waiters
authorSean Christopherson <seanjc@google.com>
Thu, 22 May 2025 23:52:18 +0000 (16:52 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 23 Jun 2025 16:50:58 +0000 (09:50 -0700)
commit0d09582b3a607436fd91d6ce813048a048ecbf10
tree5e8d7a18bf471c026f94c190b365d040ba1eec40
parenta52664134a24f3b0c425781082ce993617fc2797
sched/wait: Add a waitqueue helper for fully exclusive priority waiters

Add a waitqueue helper to add a priority waiter that requires exclusive
wakeups, i.e. that requires that it be the _only_ priority waiter.  The
API will be used by KVM to ensure that at most one of KVM's irqfds is
bound to a single eventfd (across the entire kernel).

Open code the helper instead of using __add_wait_queue() so that the
common path doesn't need to "handle" impossible failures.

Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250522235223.3178519-9-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
include/linux/wait.h
kernel/sched/wait.c