[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: condvar performance in .59 vs .60



Jamie Lokier wrote:

> Would a synchronous wakeup help?  Synchronous wakeup means that the
> woken task doesn't preempt the waker, as it is assumed the waker will
> sleep soon.  I'm not sure if this example is appropriate for a
> synchronous wakeup, but the mechanism is there in the kernel if it's useful.

The best solution is to get requeue working (although two syscalls are
made).

Alternatively, if the woken just gets added to the runqueue but doesn't
replace the waker that would be OK, too.  What happens in cond_signal is
that the waker releases a lock upon return which the woken thread has to
get when it returns from the syscall.  If the woken thread preempts the
waker it'll immediately go to sleep, with two more syscalls which could
be been avoided.

If on SMP systems the woken thread perhaps gets scheduled on another CPU
that be OK, too.  Then the waker at least gets the chance to finish its
work.

-- 
--------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]