RFC: Scheduler scalability – Per-CPU runqueue + double_rq_lock mechanism like Linux #107138
AndyLiuQian
started this conversation in
RFC
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi Zephyr community,
I have a question and RFC about scheduler scalability under SMP when CONFIG_SCHED_PINMASKONLY is enabled.
Currently, when
SCHED_PINMASKONLYis enabled, Zephyr already uses per-CPU runqueues (each CPU has its own runqueue).However, the scheduler still uses a single global scheduler lock to protect all runqueue operations.
This creates a scalability bottleneck on SMP systems:
In Linux, this problem is solved by:
My questions are:
Since we already have per-CPU runqueue under SCHED_PINMASKONLY,could we replace the global scheduler lock with per-CPU runqueue locks?
For cross-CPU task migration, can we implement a double_rq_lock() mechanism like Linux:
I think this would greatly improve SMP scalability without breaking existing functionality,
since per-CPU runqueues are already there.
Looking forward to your thoughts!
All reactions