Re: Is it bad to have lots of sleeping tasks?

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Fri Aug 24 2001 - 15:05:09 EST


> My questions are these:
> 1) Are there any kernel structures that are O(n) or just as bad, where n is
> the total number of processes, not just the total number of runnable
> processes? i.e. will the performance of the system be adversely affected by
> the number of tasks in wait queues?

Linus scheduler is pretty dire beyond about 8 runnable threads, but very
good below that. It also has a refresh loop that is O(n) tasks, which is
strange, and actually looks easily to eliminate.

The critical bit is threads runnable at any given time. When that is low as
it is in almost all normal workloads the performance of the scheduler is
very good indeed.

> 2) If I have 1000 threads, and each calls sleep(), I assume that my
...
> difference in the system's responsiveness?

Read kernel/timer.c.

Alan
-
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 : Fri Aug 31 2001 - 21:00:13 EST