79564449

Date: 2025-04-09 13:28:17
Score: 0.5
Natty:
Report link

As far as the Linux kernel scheduler is concerned (v6.14), migration_cpu_stop running on a source cpu calls move_queued_task which grabs the runqueue lock on the destination cpu.

Releasing this lock pairs with acquiring the runqueue lock by the scheduler on the destination cpu. It acts as a release-acquire semi-permeable memory ordering to order prior memory accesses from the source CPU before the following memory accesses on the destination CPU.

Note that in addition to the migration case, the membarrier system call has even stricter requirements on memory ordering, and requires memory barriers near the beginning and end of scheduling. Those can be found as smp_mb__after_spinlock() early in __schedule(), and within mmdrop_lazy_tlb_sched() called from finish_task_switch().

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Mathieu Desnoyers