# CPU usage (part 2)



## enuiga (May 10, 2015)

Hi,

This is a follow up from thread Thread cpu-usage.51414, which I thought was completely solved.

As it was suggested, I have enabled powerd(), but my notebook still makes excessive noise for anything other than a text editor... I have tried to run powerd() with the lowest performance option, but even in this situation I couldn't succeed.

I would like to know if I have to do something else.

Here is my /etc/rc.conf:


```
powerd_enable="YES"
powerd_flags="-a adp -b min -n adp -p50"
```

I'm using FreeBSD 10.1. Any help would be appreciated.


----------



## enuiga (May 13, 2015)

getopt, I've specified the options as you suggested, but it's still the same.

Here is the output from `grep power /var/log/*`, after using the system for some minutes:


```
/var/log/auth.log:Mar 29 17:27:46 playground shutdown: power-down by root:
/var/log/auth.log:Mar 29 19:25:22 playground shutdown: power-down by root:
/var/log/auth.log:Mar 29 22:45:36 playground shutdown: power-down by root:
/var/log/auth.log:May  6 18:35:50 playground shutdown: power-down by nr:
/var/log/messages:May 10 11:51:09 playground kernel: uhub1: 4 ports with 4 removable, self powered
/var/log/messages:May 10 11:51:09 playground kernel: uhub0: 2 ports with 2 removable, self powered
/var/log/messages:May 10 11:51:09 playground kernel: uhub2: 2 ports with 2 removable, self powered
/var/log/messages:May 10 11:51:09 playground kernel: uhub3: 6 ports with 6 removable, self powered
/var/log/messages:May 10 11:51:09 playground kernel: uhub4: 8 ports with 8 removable, self powered
/var/log/messages:May 10 14:13:24 playground kernel: uhub1: 4 ports with 4 removable, self powered
/var/log/messages:May 10 14:13:24 playground kernel: uhub0: 2 ports with 2 removable, self powered
/var/log/messages:May 10 14:13:24 playground kernel: uhub2: 2 ports with 2 removable, self powered
/var/log/messages:May 10 14:13:24 playground kernel: uhub3: 6 ports with 6 removable, self powered
/var/log/messages:May 10 14:13:24 playground kernel: uhub4: 8 ports with 8 removable, self powered
/var/log/messages:May 10 15:14:27 playground devd: Executing '/etc/rc.d/power_profile 0x00'
/var/log/messages:May 10 15:14:27 playground power_profile: changed to 'economy'
/var/log/messages:May 10 15:14:47 playground devd: Executing '/etc/rc.d/power_profile 0x01'
/var/log/messages:May 10 15:14:47 playground power_profile: changed to 'performance'
/var/log/messages:May 10 15:30:35 playground devd: Executing '/etc/rc.d/power_profile 0x00'
/var/log/messages:May 10 15:30:36 playground power_profile: changed to 'economy'
/var/log/messages:May 10 16:21:46 playground devd: Executing '/etc/rc.d/power_profile 0x01'
/var/log/messages:May 10 16:21:46 playground power_profile: changed to 'performance'
/var/log/messages:May 10 20:37:09 playground kernel: uhub1: 4 ports with 4 removable, self powered
/var/log/messages:May 10 20:37:09 playground kernel: uhub0: 2 ports with 2 removable, self powered
/var/log/messages:May 10 20:37:09 playground kernel: uhub2: 2 ports with 2 removable, self powered
/var/log/messages:May 10 20:37:09 playground kernel: uhub3: 6 ports with 6 removable, self powered
/var/log/messages:May 10 20:37:09 playground kernel: uhub4: 8 ports with 8 removable, self powered
/var/log/messages:May 11 09:59:50 playground kernel: uhub1: 4 ports with 4 removable, self powered
/var/log/messages:May 11 09:59:50 playground kernel: uhub0: 2 ports with 2 removable, self powered
/var/log/messages:May 11 09:59:50 playground kernel: uhub2: 2 ports with 2 removable, self powered
/var/log/messages:May 11 09:59:50 playground kernel: uhub3: 6 ports with 6 removable, self powered
/var/log/messages:May 11 09:59:50 playground kernel: uhub4: 8 ports with 8 removable, self powered
/var/log/messages:May 11 10:00:05 playground devd: Executing '/etc/rc.d/power_profile 0x01'
/var/log/messages:May 11 10:00:05 playground power_profile: changed to 'performance'
/var/log/messages:May 12 22:25:09 playground kernel: uhub1: 4 ports with 4 removable, self powered
/var/log/messages:May 12 22:25:09 playground kernel: uhub0: 2 ports with 2 removable, self powered
/var/log/messages:May 12 22:25:09 playground kernel: uhub2: 2 ports with 2 removable, self powered
/var/log/messages:May 12 22:25:09 playground kernel: uhub3: 6 ports with 6 removable, self powered
/var/log/messages:May 12 22:25:09 playground kernel: uhub4: 8 ports with 8 removable, self powered
/var/log/messages:May 12 22:25:50 playground devd: Executing '/etc/rc.d/power_profile 0x01'
/var/log/messages:May 12 22:25:50 playground power_profile: changed to 'performance'
```

It didn't show anything about powerd(). I don't know if that is the expected result.


----------



## junovitch@ (May 15, 2015)

powerd(8) doesn't log the frequency changes.  It would be an immense amount of logs if it did.  Try running `powerd -v <your powerd flags>` in a separate shell and seeing if that provides any insight on what normally happens in the background.


----------



## enuiga (May 17, 2015)

Running powerd(8) in verbose mode I could see that CPU usage is exceeding 100%. I don't know if it is correct,  but it raises some suspicions.

I attached a file with the log messages from powerd(8). For that output, I was watching a video on YouTube with Firefox.


----------



## abishai (May 17, 2015)

enuiga said:


> exceeding 100%


This means that `powerd` is asking for a turbo boost.
Actually, I don't understand what you try to achieve. According logs, `powerd` just does his job - increasing frequency under load. 200% assumes you loaded 2 CPU cores fully. Isn't it the situation the perfomance needed? If you want ask it be more conservative, there are 2 options `-r` and `-i` according powerd(8) - set the first and the latter to 95%


----------



## junovitch@ (May 17, 2015)

It looks like powerd(8) is working.  You may find this article of interest as it explains the Intel TurboBoost/SpeedStep technology in a bit more detail and clarifies what powerd(8) is doing behind the scenes.

http://www.ateamsystems.com/tech-blog/increase-freebsd-performance-with-powerd/


----------



## enuiga (May 18, 2015)

abishai, perfomance isn't the problem. I have tried to run powerd() with the lowest performance, but even in that situation I got a lot of noise after some time. What I want is to preserve performance, but without increasing the noise.

junovitch, I have read the article, but it doesn't help in this case.


----------



## junovitch@ (May 18, 2015)

Does your BIOS have any options to tweak fan speed?  You may be able to pick a less aggressive setting that will run quieter at the expense of running a bit warmer.


----------



## enuiga (May 21, 2015)

junovitch, it hasn't. But I think it's a configuration issue, because as I have said with Slackware my box was running as expected.

Maybe FreeBSD require more CPU processing than Slackware?

I will continue to research on this, but I would like to hear some opinions.


----------

