Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-96332

Remove timed wakeups from SemaphoreTIcketHolder

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Workload Scheduling

      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

            Assignee:
            Unassigned Unassigned
            Reporter:
            george.wangensteen@mongodb.com George Wangensteen
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: