Rather than using the swi infrastructure, rewrite softclock() as a
thread loop (softclock_thread()) and use it as the main routine of the
softclock threads. The threads use the CC_LOCK as the thread lock
when idle.
Sponsored by: Netflix
Differential D33683
softclock: Use dedicated ithreads for running callouts. jhb on Dec 28 2021, 7:33 PM. Authored by Tags None Referenced Files
Details Rather than using the swi infrastructure, rewrite softclock() as a Sponsored by: Netflix
Diff Detail
Event TimelineComment Actions One possible downside I can guess in sched_add() calling sched_pickcpu() under the CC_LOCK, if I understand it right, but may be it will be some compensated by reduced complexity. Comment Actions This seems fine... Have a question about the locks that likely could be clarified with a few words...
Comment Actions Yes, but in general a thread needs some sort of thread_lock when it is idle. When you are asleep on a sleep queue it is the associated SC_LOCK, or when blocked on a turnstile the TC_LOCK. ithreads are currently a bit of an odd ball as they end up staying with the "running lock" even when idle. Reusing the cc_lock as the thread lock means you don't have to grab the "running lock" just to schedule the thread but can instead reuse the spin lock that is already held to interlock against going to sleep in softclock_thread().
Comment Actions
|