Re: [patch] writeback daemons

Andrew Morton
2002-04-15T20:38:43Z

Pavel Machek wrote:
>
> Hi!
>
> > The number of threads is dynamically managed by a simple
> > demand-driven algorithm.
>
> So... when we are low on free memory, we try to create more threads... Possible
> deadlock?

Nope. The number of threads is never allowed to fall below two,
for this very reason.

If the machine is super-low on memory, attempts to start more threads
fail (usually due to the 1-order allocation for the kernel stack).
I've seen this happen. But the existing two threads are safe,
and that's plenty to get the machine out of trouble.

-