-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Workload Scheduling
-
WS Prioritized List
Today SemaphoreTIcketHolder makes operations wait on a futex when no tickets are available. Since all operations wait on the same futex, the wait is uninterruptible, so each operation uses a series of at-most-500ms timed-waits, checking for interrupt between each wait, to avoid blocking for too long without checking for interrupt.
The 500ms interval between check-for-interrupts means that, in the worst case, we could extend step-down by 500ms as the stepdown machinery waits for each operation holding the RSTL to die so it can acquire the lock, as tickets are taken after the RSTL.
It would be better if we could wait interruptible rather than relying on timed wakeups to check for interrupt. This could be done using a mutex + stdx::condition_variable, using the ParkingLot abstraction, or some other mechanism.
Alternatively, if we struggle to remove the timed wakeup, we could just notify the futex as part of the stepdown machinery to force everything to wake up and check for interrupt immediately
- is related to
-
SERVER-89297 Implement a TicketHolder using a Notifyable waiter list
- Closed
-
SERVER-97112 Complete TODO listed in SERVER-89297
- Closed