bin/113813: [fix] terminating powerd should restore max CPU frequency

Simun Mikecin numisemis at
Mon Jun 18 09:50:09 UTC 2007

>Number:         113813
>Category:       bin
>Synopsis:       [fix] terminating powerd should restore max CPU frequency
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 18 09:50:08 GMT 2007
>Originator:     Simun Mikecin
>Release:        6.2-RELEASE i386
FreeBSD 6.2-RELEASE-p2 FreeBSD 6.2-RELEASE-p2 #0: Mon Mar  5 10:23:07 CET 2007     root at  i386

If just booted, before starting powerd daemon CPU frequency should be setup to the maximum possible value. Terminating (for example, by sending it a SIGTERM signal) powerd daemon should restore that frequency.
Currently it does not do that. It leaves the frequency as it was. Which depends on the configuration of powerd (power source, etc.) and of the CPU load in the time it was terminating.

As I can see, /etc/rc.d/powerd script already has powerd_poststop() which should restore the frequency.
Unfortunatelly, in some situations it doesn't work, since powerd can be stopped without running /etc/rc.d/powerd script, but by sending a signal directly to the powerd daemon.

You are running multiuser with powerd which dropped the CPU frequency. As root you want to go single-user for whatever reason that is ('make installworld' is one of them), so you run 'shutdown now' as root.
powerd daemon will get terminated, but the CPU frequency will stay low.
If I try to run 'make installworld;, it would run noticeably slower since the CPU frequency is down, and can be restored only if I manually run sysctl to set it back to the maximum.


Patch attached with submission follows:

--- usr.sbin/powerd/powerd.c.orig	Sun Jan 15 18:50:37 2006
+++ usr.sbin/powerd/powerd.c	Mon Jun 18 11:27:56 2007
@@ -494,6 +494,7 @@
+	set_freq(freqs[0]);
 	if (!vflag)


More information about the freebsd-bugs mailing list