Commit Graph

58 Commits

Author SHA1 Message Date
Baptiste Daroussin
79477f3ca1 Directly set the NONBLOCK flags when creating the socket
No functional changes
2016-05-10 11:18:53 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
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
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Alexander Motin
0e2a18e657 Add comment explaining existing powerd behavior on SMP systems.
MFC after:	1 week
2015-03-20 15:07:05 +00:00
Baptiste Daroussin
c6db8143ed Convert usr.sbin to LIBADD
Reduce overlinking
2014-11-25 16:57:27 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
3b8f084595 Merge head 2014-04-28 07:50:45 +00:00
Christian Brueffer
a051bcb130 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.net>
Reviewed by:	jhb
MFC after:	2 weeks
2014-02-11 15:16:49 +00:00
Simon J. Gerraty
d1d0158641 Merge from head 2013-09-05 20:18:59 +00:00
Warren Block
3e01326432 Whitespace fixes: remove tabs on blank links, spaces following content,
tabs after spaces.

Reviewed by:	gjb
MFC after:	1 week
2013-07-04 18:59:58 +00:00
Warren Block
27f90bebef Put the power modes in a list to make them easier to find.
Reviewed by:	joel
MFC after:	1 week
2013-07-04 12:24:39 +00:00
Simon J. Gerraty
7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Robert Millan
7b3b368344 Improve error reporting when no cpufreq(4) support is available.
Reviewed by:	njl, acpi
2012-04-09 20:59:14 +00:00
Ed Schouten
e120624d32 Add missing static keyword.
All global variables and functions in powerd are marked static, except
this array of strings. Add the keyword, for consistency.
2011-12-11 19:22:42 +00:00
Rebecca Cran
cf2280aca7 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
2010-08-17 09:11:38 +00:00
Alexander Motin
773b251c07 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,
2010-06-16 15:09:45 +00:00
Joerg Wunsch
0a47b5f57f then -> than
MFC after:	1 day
2010-03-15 16:06:52 +00:00
Warner Losh
7a377edc31 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...
2010-02-04 07:26:26 +00:00
Ed Schouten
71ccf09269 The last big commit: let usr.sbin/ use WARNS=6 by default. 2010-01-02 11:07:44 +00:00
Ed Schouten
10bc3a7f42 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.
2009-12-29 22:53:27 +00:00
Gavin Atkinson
484b7a091f Grammar and minor tweaks to powerd(8) man page.
PR:		docs/133186
Approved by:	ed (mentor)
MFC after:	2 weeks
2009-12-21 22:56:06 +00:00
Nathan Whitehorn
ebcc3763a8 Teach powerd how to query the PMU AC line state on PowerPC. 2009-05-31 10:27:24 +00:00
Tom Rhodes
5d8e279e37 Fix a typo higter->higher.
Spotted by:	ganbold
2008-12-24 09:17:30 +00:00
Alexander Motin
8cb16fdbea Restore original frequency on exit.
PR:		bin/113813
2008-11-18 15:48:23 +00:00
Alexander Motin
dbd3197760 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@
2008-11-18 13:24:38 +00:00
David E. O'Brien
dc70a966e3 Add an abbreviation for adaptive mode, and document all the abreviations. 2008-06-22 17:52:57 +00:00
Kevin Lo
8f9872ccb3 getopt(3) returns -1, not EOF. 2008-02-18 03:19:25 +00:00
Dmitry Morozovsky
89a630d080 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
2007-06-13 19:05:11 +00:00
Dag-Erling Smørgrav
f1e58a9ac4 Back out revs 1.18 and 1.19; they were based on incorrect assumptions.
Requested by:	nate
2006-02-19 00:40:28 +00:00
Dag-Erling Smørgrav
af2cde52b3 Look for cpu/ichss instead of cpu/p4tcc, which is i386/amd64-only. 2006-02-18 16:01:07 +00:00
Dag-Erling Smørgrav
aa5cfd0420 Load cpufreq at startup if it isn't there already. 2006-02-18 11:35:12 +00:00
Dag-Erling Smørgrav
2f7a934c4f Don't use threads when there's no real reason to.
MFC after:	2 weeks
2006-01-03 21:32:02 +00:00
Joel Dahl
19797b2256 s/5.5/6.0/ in HISTORY section.
Discussed with:	ru
2005-11-24 09:25:10 +00:00
Ruslan Ermilov
78ad54210f -mdoc sweep. 2005-11-18 10:56:28 +00:00
Pawel Jakub Dawidek
177b9d3b7b Be more consistent with the rest of the manual page. 2005-11-06 20:01:47 +00:00
Nate Lawson
33a00fc0b1 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>
2005-10-24 18:34:54 +00:00
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