Subject: Re: CPU speed management API
To: Allen Briggs <briggs@netbsd.org>
From: Jason Thorpe <thorpej@shagadelic.org>
List: port-powerpc
Date: 01/23/2005 18:50:42
--Apple-Mail-2--621176045
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; format=flowed


On Jan 23, 2005, at 6:37 PM, Allen Briggs wrote:

> On Sun, Jan 23, 2005 at 03:21:00PM -0800, Jason Thorpe wrote:
>> I envisioned sysmon as being a nice centralized point for precisely
>> things like this.
>
> And what exactly is sysmon?

Ok.

sysmon is really a framework for system monitoring.  The whole idea was 
that you didn't have to know what kind of envsys devices you had ... 
acpi, via, lm78, etc... these things simply registered themselves with 
sysmon, and that is what you queried.

The same goes for things like power buttons, lid switches, etc.  You 
don't care what kind of front panel power button you have, only that 
you have one.

Same with watchdog timers.

Sysmon currently provides a central switching point for all 3 of these 
kinds of things.

So, the idea is that you could extend it to provide control going in 
the other direction, as well.  The userspace power management policy 
engine should not have to care if you have SpeedStep, CoolYourJets, or 
whatever.  Instead, these platform-specific control mechanisms should 
register themselves with sysmon, which then would provide a generic 
interface for controlling them.

That make sense?

> $ apropos sysmon
> powerd (8) - power management daemon for sysmon
>
> And powerd doesn't reference it further.

Yah, I ought to write a sysmon(9) manual page.

> I see it in src/sys/dev/sysmon, but its hard to know what it should
> be unless it's documented.  envsys still has the "This API is
> experimental and may be deprecated at any time" note on it and:

Eh, I don't really agree with that.  It's pretty well entrenched now, 
and while the argument could be made for sysctl'ing it now that we have 
a better sysctl, I think the interface should still be provided through 
sysmon... i.e. sysmon sysctls, not individual lm0.whatever.whatever 
sysctls.

Anyway, sysmon isn't just envsys.  It does other stuff, too.

> I like a couple of the aspects of cpufreq(9) in Linux, but I'd like
> to see something tied into the things that sysmon has under its
> control.  I haven't yet looked to see what, if anything, any other
> BSD is doing in this area.

I'm not familiar with cpufreq(9), but it's certainly reasonable to mine 
it for ideas for a similar subsystem in sysmon.  So long as the API is 
generic enough to represent different configuration models for this 
type of thing.

         -- Jason R. Thorpe <thorpej@shagadelic.org>


--Apple-Mail-2--621176045
content-type: application/pgp-signature; x-mac-type=70674453;
	name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFB9GKCOpVKkaBm8XkRAnuGAKC+kAPatrhC9it1fVCvmbCruUY9eQCfa4lX
m+oRh9rCqkFHxHsTuLv0LgU=
=9OAe
-----END PGP SIGNATURE-----

--Apple-Mail-2--621176045--