Subject: Re: IO throttle VOP
To: None <tech-kern@netbsd.org>
From: Frank van der Linden <fvdl@wasabisystems.com>
List: tech-kern
Date: 12/20/2001 12:36:00
On Wed, Dec 19, 2001 at 10:17:01AM -0000, David Laight wrote:
> Is there actually a deadlock if you sleep the process when it tries to
> add a request?

Deadlock scenarios are possible. The syncer skips locked vnodes
to avoid deadlocks. So if you have a couple of processes that,
for example, each create a huge amount of subdirs in a directory,
they will a) create a lot of softdeps, and b) typically have
the directory locked. If they sleep, waiting for resources to
be made available because ths syncer does some cleaning up,
the softdeps that they just created themselves will not be
cleaned out, because they have that vnode locked.

This is why you need to sleep at a time at which you are certain
that you know which locks are held, so that they can be temporarily
dropped. This is harder to do when you do it in the guts of the
filesystem code itself; the only time at which you can be 100%
sure is from the system call code.

- Frank

-- 
Frank van der Linden                           fvdl@wasabisystems.com
======================================================================
Quality NetBSD CDs, Support & Service.   http://www.wasabisystems.com/