Created attachment 153318 [details]
Fix comment in sched_balance_pair and move load check ahead of lock
Comment in sched_balance_pair suggests that it may balance more than one thread at a time, while tdq_move operates on only one thread.
Also move load check to before tdq_lock_pair, as the tdq lock is not required to
(In reply to Harrison Grundy from comment #0)
- if (high->tdq_load <= low->tdq_load)
+ if (high->tdq_load <= low->tdq_load)
Created attachment 153321 [details]
Maybe still "high-> tdq_transferable! = 0" because "tdq_transferable - transferable thread count". And if the counter is already 0, then the thread can not be transferable?
It still checks that in the lower if. We can't check tdq_transferable without the lock.