Skip to content

Kernel: Blocking overhaul and missing synchronization primitives #26108

@Hendiadyoin1

Description

@Hendiadyoin1

We currently have the following Synchronization "Primitives":

  • Mutex: Rather efficient lock interacting with the scheduler
  • Spinlock: Hot loop lock, May be Rank aware enforcing acquisition order
  • WaitQueue: Not quite a condition variable, uses Blockers
  • Blockers/BlockerSets: Similar to wait queues, but usually special purpose and support timeouts
    Like for Futices, Thread joins or ARP routing

The main issues are as follows

  • There is a special BigLock mutex, which is very broadly scoped and needs special handling in a lot of places
    Ideally this should be removed (ongoing effort)
  • Blockers are not very well documented
  • WaitQueue cannot virtually atomically unblock mutices or Spinlocks, which would make it a full CV
  • The blocking code is quite old and crusty in some places, dancing with a lot of unranked Spinlocks
  • Do we really need RecursiveSpinlocks in this many places
    like why is a mutexes block list recursive-spinlock protected?

Missing (useful) Primitives may include

  • proper Condition Variables (see above)
  • Latches for tracking asynchronous HW task completion (Usually may also be doable with a CV and may CVs to work)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions