Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Aug 2001 17:56:28 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Greg Lehey <grog@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/conf options src/sys/i386/conf NOTES src
Message-ID:  <XFMail.010823175628.jhb@FreeBSD.org>
In-Reply-To: <20010824102127.A21776@wantadilla.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 24-Aug-01 Greg Lehey wrote:
> On Thursday, 23 August 2001 at 17:27:10 -0700, John Baldwin wrote:
>>
>> On 24-Aug-01 Greg Lehey wrote:
>>> On Thursday, 23 August 2001 at 13:32:21 -0700, John Baldwin wrote:
>>>> jhb         2001/08/23 13:32:21 PDT
>>>>
>>>>   Modified files:
>>>>     sys/conf             options
>>>>     sys/i386/conf        NOTES
>>>>     sys/kern             kern_shutdown.c
>>>>     sys/sys              param.h
>>>>   Log:
>>>>   Add a new kernel option RESTARTABLE_PANICS.  If this option is present,
>>>>   then one can restart from a panic by resetting the panicstr variable to
>>>>   NULL.  This commit conditionalizes the previously committed
>>>>   functionality
>>>>   on this variable.  It also removes the __dead2 attribute from the
>>>>   panic()
>>>>   function so that when one continues from a panic() the behavior will
>>>>   be predictable.
>>>
>>> The only way I can see to restart from a panic is to enter the
>>> debugger and then return, and your code seems to bear this out.  Am I
>>> missing something?  I would think that we can always return from the
>>> debugger if we want to continue, and that the RESTARTABLE_PANICS and
>>> check for null format string are not necessary.  Are you concerned
>>> about people who will return from the debugger when they don't mean
>>> to?  There are plenty of other ways to shoot down the system from the
>>> debugger.
>>
>> Err. If you continue from the debugger, the panic() function calls boot()
>> which
>> reboots the system.  If you chagne panicstr to NULL, then we don't call
>> boot()
>> but return from panic(), thus effectively turning the panic() into a
>> Debugger().
> 
> So reset the panic string.
> 
>#if defined(DDB)
>       if (debugger_on_panic) {
>               Debugger ("panic");
>               panicstr = NULL;
>#ifdef SMP
>               atomic_store_rel_int(&panic_cpu, NOCPU);
>#endif
>               return;
>       }
>#endif
>       boot(bootopt);
> 
> Greg

Ah, no.  The intent is not to restart from all panics.  This lets you, the
developer, decide at panic time if one wants to try and restart or not.  If you
do, you clear panicstr, otherwise it panics normally.

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.Baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010823175628.jhb>