History log of /freebsd-10-stable/usr.sbin/powerd/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
342983 13-Jan-2019 avos

MFC r342810:
powerd(8): allow to force a method of battery state query

This change allows to determine power source via sysctl or /dev/apm
when devd(8) is running (used by default).

Based on patch from PR; other changes on top of it:
- '-f' (force) -> '-s' (source) parameter renaming;
- allow 'apm' -> 'devd' transition when '-s devd' is set
(if APM is enabled);
- man page update.

PR: 125707
Submitted by: Konstantin Stepanov <milezv@yandex.ru>
Reviewed by: bcr, imp
Differential Revision: https://reviews.freebsd.org/D18742

280751 27-Mar-2015 mav

MFC r280286: Add comment explaining existing powerd behavior on SMP systems.

262474 25-Feb-2014 brueffer

MFC: r261773

In acline_init(), initialize ac_line to SRC_UNKNOWN. Previously
this could lead to the -n option effectively being ignored (in case
ac_line happened to be 0 aka SRC_AC), or other undefined behaviour.

PR: 169779
Submitted by: Alex Gonzalez <loox at e-shell.com>
Reviewed by: jhb

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


252713 04-Jul-2013 wblock

Whitespace fixes: remove tabs on blank links, spaces following content,
tabs after spaces.

Reviewed by: gjb
MFC after: 1 week


252696 04-Jul-2013 wblock

Put the power modes in a list to make them easier to find.

Reviewed by: joel
MFC after: 1 week


234070 09-Apr-2012 rmh

Improve error reporting when no cpufreq(4) support is available.

Reviewed by: njl, acpi


228416 11-Dec-2011 ed

Add missing static keyword.

All global variables and functions in powerd are marked static, except
this array of strings. Add the keyword, for consistency.


211415 17-Aug-2010 brucec

Add -m and -M options to control the minimum and maximum frequency.

PR: bin/145063
Submitted by: Boris Kochergin <spawk at acm.poly.edu>
Reviewed by: cperciva
Approved by: rrs (mentor)
MFC after: 2 weeks


209234 16-Jun-2010 mav

Freq sysctls are quite heavy due to set of malloc()/free() calls. Avoid
reading current frequency on every period. Instead do it only after
changing and periodically from time to time if somebody else change it.

Also dynamically decrease sampling frequency up to 4 times on inactivity,


205170 15-Mar-2010 joerg

then -> than

MFC after: 1 day


203482 04-Feb-2010 imp

Since APM is a legacy technology, that won't be adapted to other
platforms, move the test for i386 from the Makefile to powerd.c. The
powerpc specific checks are already done this way...


201390 02-Jan-2010 ed

The last big commit: let usr.sbin/ use WARNS=6 by default.


201227 29-Dec-2009 ed

ANSIfy almost all applications that use WARNS=6.

I was considering committing all these patches one by one, but as
discussed with brooks@, there is no need to do this. If we ever
need/want to merge these changes back, it is still possible to do this
per application.


200819 21-Dec-2009 gavin

Grammar and minor tweaks to powerd(8) man page.

PR: docs/133186
Approved by: ed (mentor)
MFC after: 2 weeks


193161 31-May-2009 nwhitehorn

Teach powerd how to query the PMU AC line state on PowerPC.


186476 24-Dec-2008 trhodes

Fix a typo higter->higher.

Spotted by: ganbold


185053 18-Nov-2008 mav

Restore original frequency on exit.

PR: bin/113813


185050 18-Nov-2008 mav

Set of powerd enchancements:

1. Make it more SMP polite. Previous version uses average CPU load that
often leads to load underestimation. It make powerd with default
configuration unusable on systems with more then 2 CPUs. I propose to use
summary load instead of average one. IMO this is the best we can do without
specially tuned scheduler. Also as soon as measuring total load on SMP
systems is more useful then total idle, I have switched to it.

2. Make powerd's operation independent from number and size of frequency
levels. I have added internal frequency counter which translated into real
frequencies only on a last stage and only as good as gone. Some systems may
have only several power levels, while others - many of them, so adaptation
time with previous approach was completely different.

3. As part of previous I have changed adaptive mode to rise frequency on
demand up to 2 times and fall on 1/8 per time internal.

4. For desktop (AC-powered) systems I have added one more mode - "hiadaptive".
It rises frequency twice faster, drops it 4 times slower, prefers twice
lower CPU load and has additional delay before leaving the highest frequency
after the period of maximum load. This mode was specially made to improve
interactivity of the systems where operation capabilities are more
significant then power consumption, but keeping maximum frequency all the
time is not needed.

5. I have reduced default polling interval from 1/2 to 1/4 of second.
It is not so important for algorithm math now, but gives better system
interactivity.

Discussed on: mobile@


179932 22-Jun-2008 obrien

Add an abbreviation for adaptive mode, and document all the abreviations.


176380 18-Feb-2008 kevlo

getopt(3) returns -1, not EOF.


170682 13-Jun-2007 marck

Failing to set new frequency should not lead to powerd exiting.
Change err(3) to warn(3) as three other cases.

Approved by: njl, des


155826 19-Feb-2006 des

Back out revs 1.18 and 1.19; they were based on incorrect assumptions.

Requested by: nate


155810 18-Feb-2006 des

Look for cpu/ichss instead of cpu/p4tcc, which is i386/amd64-only.


155806 18-Feb-2006 des

Load cpufreq at startup if it isn't there already.


153999 03-Jan-2006 des

Don't use threads when there's no real reason to.

MFC after: 2 weeks


152755 24-Nov-2005 joel

s/5.5/6.0/ in HISTORY section.

Discussed with: ru


152569 18-Nov-2005 ru

-mdoc sweep.


152140 06-Nov-2005 pjd

Be more consistent with the rest of the manual page.


151628 24-Oct-2005 njl

Create the devd thread after we have called daemon(). Otherwise, it would
be killed when the parent exits.

Submitted by: Rudolf Cejka <cejkar / fit.vutbr.cz>


151567 23-Oct-2005 njl

Whitespace fix.


151491 20-Oct-2005 njl

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


151461 19-Oct-2005 njl

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>


150564 26-Sep-2005 des

Accept "maximum" and "minimum" modes as well as their abbreviations.

MFC after: 2 weeks


149437 24-Aug-2005 pjd

Test last minute changes, as gcc isn't too smart.

Reported by: Steve Kargl <sgk@troutmask.apl.washington.edu>


149428 24-Aug-2005 pjd

Add '-P' option which allows to specify pidfile.


149410 24-Aug-2005 bruno

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


148395 25-Jul-2005 njl

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


148139 18-Jul-2005 ume

Ignore EPERM from sysctl(3). It is returned when passive cooling
is active.

Reviewed by: njl


147438 16-Jun-2005 ru

Fixed markup.

Approved by: re


144883 10-Apr-2005 njl

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.


144873 10-Apr-2005 njl

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.


142659 27-Feb-2005 brueffer

man page -> manual page


142605 27-Feb-2005 njl

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.


142602 27-Feb-2005 marcel

Unbreak !i386 platforms. Only i386 has APM, so don't try to fallback
on APM on other platforms.


142598 26-Feb-2005 njl

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.


142594 26-Feb-2005 njl

Remove SRCS line since it isn't needed for single-source programs.
Pointed out by: ru


142577 26-Feb-2005 njl

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").