On Wed, 9 May 2001, John Baldwin wrote:

> I am more worried about the fact that you can deadlock the debugger. 
> What does the debugger do if another process hold the proc lock on the
> process you want to kill?  Cute, eh?  The debugger is an extra special
> environment.  Most of the time you've panic'ed when you are in there
> (but then the panicstr tests that skip lock operations save you from
> that).  Also, in the debugger you know that no other threads are
> running.  This is why 'show pcpu' can list spin locks on other cpu's
> safely, for example.  I'm not sure if a ddb 'kill' command shouldn't be
> better implemented using a 'trylock' and refusing to send the signal if
> it can't get the lock so it can avoid doing really bad things.  I
> suppose it wouldn't deadlock but would switch to the other task and
> start running.  Of course, this would be most disastrous if the current
> task we just dropped to the debugger in holds a spin lock. :(

It sounds like what people really want is a kernel supervisor running on a
vty, perhaps ttyv8 or something, which is a kernel process and not a user
process, and is less prone to failure than a root shell, and hence less
likely to get deadlocked on vnodes, etc, etc, which would offer some
simple management primitives in the form of "signal process to death",
"call boot(0)", etc.  This kernel process would obey locking requirements
for its operations, but would have no services that could potentially be
blocked on a vnode lock, would always be in memory, etc, making highly

However, it sounds like the trylock solution for ddb is a lot better than
ignoring the lock and introducing nastiness that way.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Project
[EMAIL PROTECTED]      NAI Labs, Safeport Network Services

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to