On Thu, May 31, 2012 at 3:45 AM, Juan Francisco Cantero Hurtado <i...@juanfra.info> wrote: > Hi. I've been using OpenBSD on my netbook daily for a few months. I was > using apmd with the -C setting. My netbook is slow and the battery life > is important, so 800Mhz (apmd -C) or 1600Mhz (apm -A) is not a big > difference for me. > > Now I have a desktop computer with support for cpu speed scaling. In > this case the options of apmd are very limited. If I use "-A" my cpu is > always at 2700Mhz, wasting energy and heating my room (I live in the > very sunny Extremadura :) ). If I use "-C", apm rarely raises the speed > and the cpu is almost always at 800Mhz. > > This is important because when I open a web page with a lot of > javascript, the browser is very slow. Also when I compile something with > "make -j1", apmd doesn't raise the speed of my CPU, I need use "make > -j4" for raising the cpu speed to 2700Mhz.
What shows top, vmstat, systat about %sys, %usr, %idle during that time? Because you can have 800MHz of CPU, but %usr and/or %sys can be eg. only 20% so there's no reason to switch to higher frequency. > > I understand the problem with the limits of apmd. The developers can't > generate a limits for each CPU and workflow. I've been playing with the > values of PERFINCTHRES and PERFDECTHRES on usr.sbin/apmd/apmd.c and > "checking" the changes of speed with "while true; do apm | grep cool; > sleep 1; done". I'm using 20 and 60 respectively right now. Probably > this values aren't the best values but are better than the defaults (for > my CPU and workflow). The performance is very good and I can see the cpu > speed raising and lowering. I've tested various values and 20/60 are a > good compromise "performance vs energy consumption". > > In short, I have a suggestion for apmd. Add one option for to set > PERFINCTHRES and other for to set PERFDECTHRES. Each user could to > configure the behavior of "apm -C" on rc.conf.local. Example: > apmd_flags="-C -I 20 -D 60". Obviously, "apm -C" would use the defaults > if both options aren't used. > > The implementation is simple and it will not break any system. > Unfortunately I can't code the idea (despite I've read the code), so I > wanted share this with you. B Some developer interested? :) > > Cheers. > > -- > Juan Francisco Cantero Hurtado http://juanfra.info