Subject: Re: Proposed code to reboot the system (Re: SS20 random hanging)
To: Laurent FAILLIE <l_faillie@yahoo.com>
From: Isaac Wagner-Muns <fubar22@gmail.com>
List: port-sparc
Date: 05/23/2007 17:33:41
i'm sorry if i'm being kinda silly here, but why would you want to =20
reboot the computer when the load gets too high? couldn't you just =20
kill processes instead? isn't that a little overkill?

On May 23, 2007, at 9:22 AM, Laurent FAILLIE wrote:

> 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 =3D 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
> =3D 0)
> 	 *	full cycle every 2 seconds if loadav =3D 1
> 	 *	full cycle every 3 seconds if loadav =3D 2
> 	 * etc.
> 	 */
>
> 	s =3D (((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
> /________/ /=09
> (#######( /	http://destroyedlolo.homeunix.org
> Quoi, des fautes d'orthographe! Pas possible ;-D.
>
>
>
>
>
> =09
> 	=09
> ______________________________________________________________________=20=

> _____
> D=E9couvrez une nouvelle fa=E7on d'obtenir des r=E9ponses =E0 toutes =
vos =20
> questions !
> Profitez des connaissances, des opinions et des exp=E9riences des =20
> internautes sur Yahoo! Questions/R=E9ponses
> http://fr.answers.yahoo.com




Those who make peaceful revolution impossible will make violent =20
revolution inevitable.
                 -- John Fitzgerald Kennedy