aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/powerd
Commit message (Collapse)AuthorAgeFilesLines
* powerd.8: Improve style & fix typosMateusz Piotrowski2020-03-031-23/+26
| | | | | | | | | | | | | | | | - Sort options. - Do not use macros (like .Ar) to specify width for Bl (macros within that string are not expanded). - Use Cm instead of Ar for mode names. - Fix some typos reported by mandoc. - Move the documentation of the PID file from the -P flag description to the FILES section. Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D23941 Notes: svn path=/head/; revision=358574
* Add -N option to powerd(8) to ignore "nice" time.Colin Percival2020-02-292-10/+26
| | | | | | | | | | | | | | | | | With powerd_flags="-N", this makes powerd(8) exclude "nice" time when computing the CPU utilization. This makes it possible to prevent CPU-intensive "background" processes from spinning up the CPU. Note that only *userland* CPU usage belonging to "nice" processes is excluded; we do not track whether time spent in the kernel is on behalf of nice or non-nice processes, so kernel-intensive nice processes can still result in the CPU being sped up. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D23868 Notes: svn path=/head/; revision=358478
* powerd(8): Fix a memory leak when we fail to read frequency levels.Mark Johnston2019-12-291-1/+3
| | | | | | | | | PR: 242967 Submitted by: Hans Christian Woithe <chwoithe@yahoo.com> MFC after: 3 days Notes: svn path=/head/; revision=356184
* powerd(8): allow to force a method of battery state queryAndriy Voskoboinyk2019-01-062-9/+55
| | | | | | | | | | | | | | | | | | | | | | | 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. Checked on amd64 with -s devd / sysctl and apm (an extra build with forced USE_APM define set was done) PR: 125707 Submitted by: Konstantin Stepanov <milezv@yandex.ru> Reviewed by: bcr, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18742 Notes: svn path=/head/; revision=342810
* powerd: correct ifdef check for ppcEitan Adler2018-06-271-1/+1
| | | | | | | Reviewed by: jhibbits Notes: svn path=/head/; revision=335683
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Directly set the NONBLOCK flags when creating the socketBaptiste Daroussin2016-05-101-8/+1
| | | | | | | No functional changes Notes: svn path=/head/; revision=299359
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-272-2/+7
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * Merge headSimon J. Gerraty2014-04-281-0/+1
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265044
| * \ Merge from headSimon J. Gerraty2013-09-052-25/+41
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | Add comment explaining existing powerd behavior on SMP systems.Alexander Motin2015-03-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=280286
* | | | Convert usr.sbin to LIBADDBaptiste Daroussin2014-11-251-2/+1
| |_|/ |/| | | | | | | | | | | | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275054
* | | In acline_init(), initialize ac_line to SRC_UNKNOWN. PreviouslyChristian Brueffer2014-02-111-0/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | 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.net> Reviewed by: jhb MFC after: 2 weeks Notes: svn path=/head/; revision=261773
* | Whitespace fixes: remove tabs on blank links, spaces following content,Warren Block2013-07-041-8/+8
| | | | | | | | | | | | | | | | | | | | tabs after spaces. Reviewed by: gjb MFC after: 1 week Notes: svn path=/head/; revision=252713
* | Put the power modes in a list to make them easier to find.Warren Block2013-07-041-17/+33
|/ | | | | | | | Reviewed by: joel MFC after: 1 week Notes: svn path=/head/; revision=252696
* Improve error reporting when no cpufreq(4) support is available.Robert Millan2012-04-091-1/+2
| | | | | | | Reviewed by: njl, acpi Notes: svn path=/head/; revision=234070
* Add missing static keyword.Ed Schouten2011-12-111-1/+1
| | | | | | | | All global variables and functions in powerd are marked static, except this array of strings. Add the keyword, for consistency. Notes: svn path=/head/; revision=228416
* Add -m and -M options to control the minimum and maximum frequency.Rebecca Cran2010-08-172-8/+88
| | | | | | | | | | | PR: bin/145063 Submitted by: Boris Kochergin <spawk at acm.poly.edu> Reviewed by: cperciva Approved by: rrs (mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=211415
* Freq sysctls are quite heavy due to set of malloc()/free() calls. AvoidAlexander Motin2010-06-161-9/+21
| | | | | | | | | | 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, Notes: svn path=/head/; revision=209234
* then -> thanJoerg Wunsch2010-03-151-1/+1
| | | | | | | MFC after: 1 day Notes: svn path=/head/; revision=205170
* Since APM is a legacy technology, that won't be adapted to otherWarner Losh2010-02-042-4/+4
| | | | | | | | platforms, move the test for i386 from the Makefile to powerd.c. The powerpc specific checks are already done this way... Notes: svn path=/head/; revision=203482
* The last big commit: let usr.sbin/ use WARNS=6 by default.Ed Schouten2010-01-021-1/+0
| | | | Notes: svn path=/head/; revision=201390
* ANSIfy almost all applications that use WARNS=6.Ed Schouten2009-12-291-1/+1
| | | | | | | | | | 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. Notes: svn path=/head/; revision=201227
* Grammar and minor tweaks to powerd(8) man page.Gavin Atkinson2009-12-211-4/+5
| | | | | | | | | PR: docs/133186 Approved by: ed (mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=200819
* Teach powerd how to query the PMU AC line state on PowerPC.Nathan Whitehorn2009-05-311-10/+18
| | | | Notes: svn path=/head/; revision=193161
* Fix a typo higter->higher.Tom Rhodes2008-12-241-2/+2
| | | | | | | Spotted by: ganbold Notes: svn path=/head/; revision=186476
* Restore original frequency on exit.Alexander Motin2008-11-181-2/+4
| | | | | | | PR: bin/113813 Notes: svn path=/head/; revision=185053
* Set of powerd enchancements:Alexander Motin2008-11-182-89/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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@ Notes: svn path=/head/; revision=185050
* Add an abbreviation for adaptive mode, and document all the abreviations.David E. O'Brien2008-06-222-1/+2
| | | | Notes: svn path=/head/; revision=179932
* getopt(3) returns -1, not EOF.Kevin Lo2008-02-181-1/+1
| | | | Notes: svn path=/head/; revision=176380
* Failing to set new frequency should not lead to powerd exiting.Dmitry Morozovsky2007-06-131-1/+1
| | | | | | | | | Change err(3) to warn(3) as three other cases. Approved by: njl, des Notes: svn path=/head/; revision=170682
* Back out revs 1.18 and 1.19; they were based on incorrect assumptions.Dag-Erling Smørgrav2006-02-191-4/+0
| | | | | | | Requested by: nate Notes: svn path=/head/; revision=155826
* Look for cpu/ichss instead of cpu/p4tcc, which is i386/amd64-only.Dag-Erling Smørgrav2006-02-181-1/+1
| | | | Notes: svn path=/head/; revision=155810
* Load cpufreq at startup if it isn't there already.Dag-Erling Smørgrav2006-02-181-0/+4
| | | | Notes: svn path=/head/; revision=155806
* Don't use threads when there's no real reason to.Dag-Erling Smørgrav2006-01-032-158/+142
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=153999
* s/5.5/6.0/ in HISTORY section.Joel Dahl2005-11-241-1/+1
| | | | | | | Discussed with: ru Notes: svn path=/head/; revision=152755
* -mdoc sweep.Ruslan Ermilov2005-11-181-1/+1
| | | | Notes: svn path=/head/; revision=152569
* Be more consistent with the rest of the manual page.Pawel Jakub Dawidek2005-11-061-2/+2
| | | | Notes: svn path=/head/; revision=152140
* Create the devd thread after we have called daemon(). Otherwise, it wouldNate Lawson2005-10-241-3/+3
| | | | | | | | | be killed when the parent exits. Submitted by: Rudolf Cejka <cejkar / fit.vutbr.cz> Notes: svn path=/head/; revision=151628
* Whitespace fix.Nate Lawson2005-10-231-1/+1
| | | | Notes: svn path=/head/; revision=151567
* Set the signal handlers before creating the thread. This is so it inheritsNate Lawson2005-10-201-4/+15
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=151491
* Use a pipe for reading devd events as another method of getting the AC lineNate Lawson2005-10-192-28/+179
| | | | | | | | | | | | | | | 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> Notes: svn path=/head/; revision=151461