Re: What is the optimum time for task switching?

From: Michael Poole (
Date: Sun Apr 30 2000 - 14:06:28 EST

Mark Zealey <> writes:

> I am interested in what the optimum time on an i386+ is for task
> switching. I would imagine that it would be quite long, as it must take
> lots of cycles to save all the reg's and load the new ones.

>From a throughput point of view, due to the overhead of a task switch
(not only in actual CPU cycles, but in terms of cache dirtying and
reloading), you only want to switch tasks when the current task
becomes blocked on I/O (or blocked for some other reason). For
interactivity and response time, you want to switch tasks
periodically. The exact frequency depends on the job mix you're
running and how stringent the response time requirements are, and
these numbers are almost impossible to determine objectively. So
there's a bit of calculation and a whole lot of guessing that goes
into determining how often you preempt a task.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sun Apr 30 2000 - 21:00:18 EST