Subject: Proposed code to reboot the system (Re: SS20 random hanging)
To: None <port-sparc@netbsd.org>
From: Laurent FAILLIE <l_faillie@yahoo.com>
List: port-sparc
Date: 05/23/2007 16:22:17
Hi all,

So, I did some search in the kernel source, especially
in sparc/sparc/auxreg.c which seems to contains BLINK
code.
My idea is to trigger a reboot if the load is too
high, by changing blink()function as bellow :

static void
blink(zero)
	void *zero;
{
	register int s;

	s = splhigh();
	LED_FLIP;
	splx(s);

        /* Reboot if the load average is too high,
         * symptom of an hanging.
         */
        if(averunnable.ldavg[0] > 10)
            reboot( 0, NULL);

	/*
	 * Blink rate is:
	 *	full cycle every second if completely idle (loadav
= 0)
	 *	full cycle every 2 seconds if loadav = 1
	 *	full cycle every 3 seconds if loadav = 2
	 * etc.
	 */

	s = (((averunnable.ldavg[0] + FSCALE) * hz) >>
(FSHIFT + 1));
	callout_reset(&blink_ch, s, blink, NULL);
}

I'll not try to sync the disk because the system is
totally unstable and I'm not sure a sync() can
succeed.

I'll really appreciate to have any comment on this
code.

Thanks & regards,

Laurent

PS: it's only a workaround, when I'll be on holliday,
I'll run a ddb enabler kernel and trying to generate a
dump when the machine is hanging.


The misspelling master is on the Web.
   _________	100 % Dictionnary Free !
  /        /(
 /  Dico  / /	Pleins d'autres fautes sur
/________/ /	
(#######( /	http://destroyedlolo.homeunix.org
Quoi, des fautes d'orthographe! Pas possible ;-D.




      
	
		
___________________________________________________________________________ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses 
http://fr.answers.yahoo.com