cvs commit: src/sys/kern kern_sig.c

David Schultz das at FreeBSD.ORG
Sun Jul 3 01:23:49 GMT 2005

On Thu, Mar 03, 2005, David Xu wrote:
> David Schultz wrote:
> >You have to worry about that anyway, though.  A and B need to know
> >that they're not allowed to hold locks across the calls if C calls
> >msleep(), for instance.  Anyway, your proposal if having a flag
> >for msleep() is basically the same as my proposal of having a
> >separate function.  (The only difference is that adding a separate
> >function doesn't break the ABI.)  So it sounds like we're more or
> >less in agreement here.
> >
> This is not a lock problem, this is the problem why a stack variable can not
> be used when thread is going to sleep, this is a rather odd behavior to me.

True, but my point is that there are *already* a bunch of rules
that have to be followed, so this is just one more.  All of the
rules that restrict what you can and can't call are bad for
modularity, and I agree that this one is particularly obnoxious.
Once again, that's why I suggested that the default be to have
msleep() disable swapping.  Then it could be selectively enabled
in a few places like the I/O path.

Of course, there's another possible solution which is to remove
the swapping code entirely.  That would certainly simplify things,
but it would also make FreeBSD degrade less gracefully under load.

More information about the cvs-all mailing list