Re: wake_up vs. wake_up_sync

From: Manfred Spraul (manfred@colorfullife.com)
Date: Wed Jun 27 2001 - 16:22:19 EST


> I'm having trouble understanding the difference between these.
> Synchronous apparently causes try_to_wake_up() to NOT call
> reschedule_idle() but I'm uncertain what reschedule_idle() is doing. I
> assume it just looks for an idle CPU and makes that CPU reschedule.
>
> What is the purpose of wake_up_sync?

Avoid the reschedule_idle() call - it's quite costly, and it could cause
processes jumping from one cpu to another.

> Why would you want to prevent
> reschedule_idle()?
>
If one process runs, wakes up another process and _knows_ that it's
going to sleep immediately after the wake_up it doesn't need the
reschedule_idle: the current cpu will be idle soon, the scheduler
doesn't need to find another cpu for the woken up thread.

I think the pipe code is the only user of _sync right now - pipes cause
an incredible amount of task switches.

--
	Manfred
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jun 30 2001 - 21:00:17 EST