Skip to content
Snippets Groups Projects
Commit 2114b426 authored by Nadav Har'El's avatar Nadav Har'El
Browse files

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).
parent 4f6303f1
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment