Commit Graph

18 Commits

Author SHA1 Message Date
Nate Lawson
b194bdc2ae Whitespace fix. 2005-10-23 00:55:56 +00:00
Nate Lawson
72699a2216 Set the signal handlers before creating the thread. This is so it inherits
the parent's signal mask.  Once daemon() forked, signals would be ignored
in the child thread.  While I'm here, check the return value of daemon().
This fixes termination in the daemon case (bug introduced in last commit).

Noticed by:	Frederik Lindberg
2005-10-20 05:12:20 +00:00
Nate Lawson
a1819ab598 Use a pipe for reading devd events as another method of getting the AC line
status.  Add a thread that waits for events on the named pipe instead of
polling the line status via apm or the ACPI sysctl.  Additionally, use
robust error handling in case devd goes away or we temporarily can't set
a frequency (i.e., passive cooling has preempted our setting).

Later, this should be improved so that if adaptive control is not being used,
we will block while waiting for AC line events, saving a little CPU.

Submitted by:	Frederik Lindberg <fli+freebsd-current/shapeshifter.se>
2005-10-19 04:48:44 +00:00
Dag-Erling Smørgrav
db20dc4dbb Accept "maximum" and "minimum" modes as well as their abbreviations.
MFC after:	2 weeks
2005-09-26 12:16:27 +00:00
Pawel Jakub Dawidek
a9ed1f7ffc Test last minute changes, as gcc isn't too smart.
Reported by:	Steve Kargl <sgk@troutmask.apl.washington.edu>
2005-08-24 19:42:40 +00:00
Pawel Jakub Dawidek
84148fd1da Add '-P' option which allows to specify pidfile. 2005-08-24 17:32:41 +00:00
Bruno Ducrot
7065e0e9f4 Change the default adaptive algorithm for phk's one. Thanks to phk
and Kevin Oberman for this work.

Submitted by:	Kevin Oberman
Reviewed by:	njl
Approved by:	njl
2005-08-24 07:52:59 +00:00
Nate Lawson
c996f586de powerd(8) requires root permissions to run so notify the user if they
try to start it without this.

Submitted by:	Philip S. Schulz
MFC after:	2 days
2005-07-25 16:43:12 +00:00
Hajimu UMEMOTO
f92a4b93c5 Ignore EPERM from sysctl(3). It is returned when passive cooling
is active.

Reviewed by:	njl
2005-07-18 20:15:31 +00:00
Ruslan Ermilov
83c94dadce Fixed markup.
Approved by:	re
2005-06-16 20:01:43 +00:00
Nate Lawson
2f8ad6c087 Drop the default running value to 60% from 80%. Testing shows that we
cycle too much, wasting power if we trigger a jump to full speed too
easily.  CPU-bound tasks quickly push idle below this level.
2005-04-10 20:42:55 +00:00
Nate Lawson
ab19351c39 Add support for recording the total energy used (in joules) when in
verbose mode.  This is useful for profiling new adaptive algorithms
in performance (via time(1)) and total energy consumed for a given
workload.
2005-04-10 19:02:29 +00:00
Christian Brueffer
7f2f06281c man page -> manual page 2005-02-27 15:49:07 +00:00
Nate Lawson
48bd710904 Move the AC line checking code into its own function, reducing the
ifdef __i386__ stuff for APM.  Tested as working correctly on i386 and
compile-tested on sparc64.
2005-02-27 01:58:49 +00:00
Marcel Moolenaar
5f4aa96715 Unbreak !i386 platforms. Only i386 has APM, so don't try to fallback
on APM on other platforms.
2005-02-27 00:23:19 +00:00
Nate Lawson
b3c9af5615 Change the default levels for adaptive mode to 80% and 90%. On a system
with moderate IO going on, system usage can hover around 65-77% even
though it would benefit from higher performance.  Typically, only truly
idle systems pass the 90% mark so only demote then.
2005-02-26 23:22:00 +00:00
Nate Lawson
a9039b10b7 Remove SRCS line since it isn't needed for single-source programs.
Pointed out by:	ru
2005-02-26 22:50:25 +00:00
Nate Lawson
5883360b2f Import powerd(8), a utility for managing power consumption. Currently, it
just uses cpufreq(4) but in the future it should also do things like spin
down disks.  This is based on the work by Colin Percival (called "estctrl").
2005-02-26 21:17:31 +00:00