Subject: Re: New power management framework for sysmon
To: Jason Thorpe <thorpej@wasabisystems.com>
From: Steven M. Bellovin <smb@research.att.com>
List: current-users
Date: 04/20/2003 14:44:16
In message <2921B2FE-735C-11D7-9DC7-000A957650EC@wasabisystems.com>, Jason Thor
pe writes:
>
>On Sunday, April 20, 2003, at 11:04  AM, Steven M. Bellovin wrote:
>
>> I confess that that scares me.  If user level gets wedged -- to pick
>> three plausible situations, if powerd depends on threads, which are
>> a bit buggy right now, or if powerd is waiting forever for some other
>> script to complete (apmd seems to have that problem), or if the disk
>> controller is hung, making it impossible to read the fan control script
>> -- you could easily end up with a fried CPU.  Are there any safety 
>> mechanisms?
>
>First of all, powerd(8) is a REALLY REALLY simple application.  No 
>threads, and it uses scripts to do all the "hard work".  The most 
>interesting thing powerd(8) does it use kqueue(2).

Good -- simple is better (though using threads might be one way to 
avoid the problem I suggested about waiting for a script to terminate).
>
>Secondly, the kernel should provide the safest defaults.  I.e. an ACPI 
>system should power up with the fans running full-tilt, and then let 
>powerd(8) adjust the fan speed to save power when it starts up.  (This 
>has not been implemented in powerd(8) yet; I'm just saying how it 
>should work :-)

Sure -- that's exactly what the kernel should do.  I'm concerned about 
what happens after powerd has lowered the fan speed.
>
>Thirdly, if the kernel detects the temperature is about to go critical, 
>it should override whatever powerd(8)'s policy is.  Firmware on some 
>systems does this for you already (temp gets too high, shuts the power 
>off for you).

Sounds good.  I take it from the word "should" that that isn't 
implemented yet...

		--Steve Bellovin, http://www.research.att.com/~smb (me)
		http://www.wilyhacker.com (2nd edition of "Firewalls" book)