Hi,

I just ran powerd(8) in verbose mode and found that it isn't correct count load.

# powerd -v
powerd: unable to determine AC line status
load 323%, current freq 2409 MHz ( 0), wanted freq 4818 MHz
load 222%, current freq 2409 MHz ( 0), wanted freq 4818 MHz
load 213%, current freq 2409 MHz ( 0), wanted freq 4818 MHz
load 151%, current freq 2409 MHz ( 0), wanted freq 4818 MHz
load 170%, current freq 2409 MHz ( 0), wanted freq 4818 MHz

I think load should be divided by the number of CPUs.

Attached patch solves the problem.

--
Andrey Zonov
Index: usr.sbin/powerd/powerd.c
===================================================================
--- usr.sbin/powerd/powerd.c    (revision 235394)
+++ usr.sbin/powerd/powerd.c    (working copy)
@@ -168,6 +168,7 @@
                        *load += 100 - (cp_times[cpu * CPUSTATES + CP_IDLE] - 
                            cp_times_old[cpu * CPUSTATES + CP_IDLE]) * 100 / 
total;
                }
+               *load /= ncpus;
        }
 
        memcpy(cp_times_old, cp_times, cp_times_len);
_______________________________________________
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Reply via email to