[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#110273: ITP: lvcool -- "cools" the AMD K7 (Athlon/Duron) CPU



On Wed, Aug 29, 2001 at 11:25:51AM +0200, Eduard Bloch wrote:
> #include <hallo.h>
> Andreas Bombe wrote on Tue Aug 28, 2001 um 11:48:49PM:
> 
> > > > No, it won't.  The disconnect is disabled by most BIOSes for various
> > > > reasons[1] and ACPI essentially just executes BIOS provided bytecode.
> > > 
> > > Exactly.
> > 
> > Yep, ACPI will do STPGNT by itself.
> 
> What, the disconnect? This must be enabled explicitely using the special
> register in the northbridge of KT133(A).

Only once.

> > I'm not sure whether APM handles the STPGNT mode.  I guess it depends on
> > the BIOS again.
> 
> AFAIK it does not. Only ACPI manager can change to STPGNT, and this
> without the clock disconnect.

It's front side bus disconnect, not clock disconnect.  Both APM and ACPI
execute BIOS provided code.  So it really does depend on BIOS.

And if you haven't realized yet, the disconnect can not be initiated by
software but only by the north bridge.  The one bit just configures
whether or not the north bridge initiates the disconnect protocol on
STPGNT or not.

If the bit is set, then it will disconnect no matter whether the STPGNT
is caused by lvcool, APM, ACPI or someone poking into the STPGNT line on
the motherboard.


Another point is that LVCool.cpp looks like a DOS program ported just
enough to make it compile and run under Linux.  It scans the PCI bus for
the VIA chipset by poking hardware registers when it could just as well
look it up in /proc/bus/pci/devices.  Then comes the part that says:

	// enable ACPI and find I/O-Space

I mean, wtf is it doing there?  It writes something to a register to
"enable ACPI"?  Potentially messing with system configuration without
telling Linux.

> > Now to your comparison kapm-idled/lvcool timeslices.  The APM code uses
> > insight into the scheduling situation to idle only when no processes are
> > ready to run.  This may cause it not to idle constantly with certain
> 
> Exactly.
> 
> > program run patterns.  If you want it to idle more often, just remove
> > the checks.
> 
> Where are this checks? I cannot find the part quickly, please point me
> to it.

For apm, I have just hacked up this little patch.  Beware, I haven't
tested or even compiled it.  Use at your own risk.  With that patch,
kapm-idled should be about just as rude as lvcool.


diff -ru linux-2.4.orig/arch/i386/kernel/apm.c linux-2.4.apmhack/arch/i386/kernel/apm.c
--- linux-2.4.orig/arch/i386/kernel/apm.c	Sun Aug 26 22:57:03 2001
+++ linux-2.4.apmhack/arch/i386/kernel/apm.c	Wed Aug 29 23:41:12 2001
@@ -1111,7 +1111,7 @@
  * decide if we should just power down.
  *
  */
-#define system_idle() (nr_running == 1)
+#define system_idle() 1
 
 static void apm_mainloop(void)
 {
@@ -1455,6 +1455,7 @@
 	strcpy(current->comm, "kapm-idled");
 	sigfillset(&current->blocked);
 	current->tty = NULL;	/* get rid of controlling tty */
+	current->nice = 19;
 
 	if (apm_info.connection_version == 0) {
 		apm_info.connection_version = apm_info.bios.version;


-- 
Andreas E. Bombe <andreas.bombe@munich.netsurf.de>    DSA key 0x04880A44



Reply to: