-
- Downloads
Condvar: Don't context switch between two unlocks
Before waiting, condvar_wait releases two locks - the user's lock and its internal lock. If we reschedule after the first unlock, a waiting thread may start running, and hang when it also does condvar_wait. So let's use preempt_disable/enable around the two locks. This patch improves single-CPU performance of the cond-perf benchmark by about 10%, but this is an extreme case (cond-perf tries to do condvar_wait almost immediately after waking up from its previous wait).
Loading
Please register or sign in to comment