Re: [PATCH] HZ change for ix86

Jeremy Fitzhardinge (jeremy@goop.org)
Sun, 10 Jan 1999 14:49:17 -0800 (PST)


On 10-Jan-99 Horvath Karoly wrote:
>> If N tasks are CPU bound, you sure want a long time-slice before the
>> CPU gets stolen from you.
>
> Why? Each of the N processes gets the 1/N of the CPU - wheter there are
> long or short timeslices. If you have the CPU for long time, you'll miss
> it for long time...

Right, but if you're CPU-bound, then it doesn't matter how long the time-slice
is. It doesn't matter if your time-slices are 1Hz or 1kHz, except that you
waste less time in switching with a 1Hz rate. If you arn't really CPU-bound -
you're interacting with the outside world with syscalls - then the timeslice
isn't the issue, its the rate you call syscalls. And of course, you run long
timeslice processes with a low priority, so an interactive processes will
always get CPU immediately if it needs to.

In general, long timeslices are better than short ones, simply because there's
less overhead. Latency isn't an issue, because that depends on how you use
syscalls. A number of schedulers will adjust timeslice quanta depending on the
nature of the load - long slices (multiple seconds) for CPU bound, and shorter
for IO-bound or interactive tasks.

>> > Why is that a problem? Here is an example:
>> > You earn 1000$ a month. Your boss decides to pay you not monthly but
>> > weekly,
>> > and you begin to complain that you earn only 250$.
>>
>> Not accurate.
>
> I think so.

Not quite. Its the same as being paied $1000/month or $250/wk, but it always
costs $10 to deposit your payment.

J

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