public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Forest Bond <forest@alittletooquiet.net>
To: linux-acpi@vger.kernel.org
Subject: Re: acpi-cpufreq; Intel Johnstown (Atom N270)
Date: Thu, 13 Aug 2009 14:29:08 -0400	[thread overview]
Message-ID: <20090813182908.GC9385@alittletooquiet.net> (raw)
In-Reply-To: <20090813172556.GB9385@alittletooquiet.net>

[-- Attachment #1: Type: text/plain, Size: 6097 bytes --]

Hi,

On Thu, Aug 13, 2009 at 01:25:57PM -0400, Forest Bond wrote:
> I'm using an Intel Johnstown board with an Atom N270 processor.  Performance
> seems to improve dramatically with acpi-cpufreq loaded.  This caught me by
> surprise.  I had assumed that without loading acpi-cpufreq the CPU would be
> running at its maximum speed all the time.

I ran some tests to get some numbers.  My findings indicate that before
acpi-cpufreq is loaded the CPU is running at 800MHz even though /proc/cpuinfo
indicates 1.6GHz.

My test just runs `yes | head -n10000000' and times the execution.  Three reps
are done for each set of conditions.  Here's a break down of the results:

======================= ============
Conditions              Average Time
----------------------- ------------
acpi-cpufreq not loaded 2.641s

acpi-cpufreq loaded     1.349s
performance governor

acpi-cpufreq loaded     2.640s
userspace governor
scaling_max_freq 800000
======================= ============

Actual results follow.

Here's my test script:

  #!/bin/bash
  
  set -o xtrace
  
  for rep in 1 2 3; do
    grep '^cpu MHz' /proc/cpuinfo
    uptime
    time yes | head -n10000000 >/dev/null
  done


Results without acpi-cpufreq:

  root@platform:~# ./test.sh
  + for rep in 1 2 3
  + grep '^cpu MHz' /proc/cpuinfo
  cpu MHz         : 1596.060
  cpu MHz         : 1596.060
  + uptime
   18:08:37 up 6 min,  1 user,  load average: 0.06, 0.66, 0.43
  + yes
  + head -n10000000
  
  real    0m2.647s
  user    0m2.844s
  sys     0m0.420s
  + for rep in 1 2 3
  + grep '^cpu MHz' /proc/cpuinfo
  cpu MHz         : 1596.060
  cpu MHz         : 1596.060
  + uptime
   18:08:40 up 6 min,  1 user,  load average: 0.13, 0.66, 0.43
  + yes
  + head -n10000000
  
  real    0m2.655s
  user    0m2.748s
  sys     0m0.528s
  + for rep in 1 2 3
  + grep '^cpu MHz' /proc/cpuinfo
  cpu MHz         : 1596.060
  cpu MHz         : 1596.060
  + uptime
   18:08:43 up 6 min,  1 user,  load average: 0.13, 0.66, 0.43
  + yes
  + head -n10000000
  
  real    0m2.622s
  user    0m2.872s
  sys     0m0.428s


Then with acpi-cpufreq and the default performance governor:

  root@platform:~# modprobe acpi-cpufreq
  root@platform:~# ./test.sh
  + for rep in 1 2 3
  + grep '^cpu MHz' /proc/cpuinfo
  cpu MHz         : 1600.000
  cpu MHz         : 1600.000
  + uptime
   18:09:11 up 6 min,  1 user,  load average: 0.13, 0.61, 0.42
  + yes
  + head -n10000000
  
  real    0m1.354s
  user    0m1.392s
  sys     0m0.240s
  + for rep in 1 2 3
  + grep '^cpu MHz' /proc/cpuinfo
  cpu MHz         : 1600.000
  cpu MHz         : 1600.000
  + uptime
   18:09:12 up 6 min,  1 user,  load average: 0.13, 0.61, 0.42
  + yes
  + head -n10000000
  
  real    0m1.339s
  user    0m1.440s
  sys     0m0.284s
  + for rep in 1 2 3
  + grep '^cpu MHz' /proc/cpuinfo
  cpu MHz         : 1600.000
  cpu MHz         : 1600.000
  + uptime
   18:09:14 up 6 min,  1 user,  load average: 0.13, 0.61, 0.42
  + yes
  + head -n10000000
  
  real    0m1.354s
  user    0m1.404s
  sys     0m0.264s
  root@platform:~# grep '' /sys/devices/system/cpu/cpu0/cpufreq/*
  /sys/devices/system/cpu/cpu0/cpufreq/affected_cpus:0 1
  /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq:1600000
  /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq:1600000
  /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq:800000
  /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies:1600000 1333000 1067000 800000
  /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors:performance
  /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq:1600000
  /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver:acpi-cpufreq
  /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor:performance
  /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq:1600000
  /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq:800000


Then with the userspace governor and the frequency set to 800MHz:

  root@platform:~# modprobe cpufreq_userspace
  root@platform:~# echo 800000 >/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  root@platform:~# grep '' /sys/devices/system/cpu/cpu0/cpufreq/*
  /sys/devices/system/cpu/cpu0/cpufreq/affected_cpus:0 1
  /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq:800000
  /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq:1600000
  /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq:800000
  /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies:1600000 1333000 1067000 800000
  /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors:userspace performance
  /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq:800000
  /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver:acpi-cpufreq
  /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor:performance
  /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq:800000
  /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq:800000
  root@platform:~# echo 800000 >/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
  root@platform:~# ./test.sh
  + for rep in 1 2 3
  + grep '^cpu MHz' /proc/cpuinfo
  cpu MHz         : 800.000
  cpu MHz         : 800.000
  + uptime
   18:12:32 up 9 min,  1 user,  load average: 0.00, 0.32, 0.34
  + yes
  + head -n10000000
  
  real    0m2.627s
  user    0m2.808s
  sys     0m0.496s
  + for rep in 1 2 3
  + grep '^cpu MHz' /proc/cpuinfo
  cpu MHz         : 800.000
  cpu MHz         : 800.000
  + uptime
   18:12:35 up 10 min,  1 user,  load average: 0.00, 0.32, 0.34
  + yes
  + head -n10000000
  
  real    0m2.643s
  user    0m2.732s
  sys     0m0.544s
  + for rep in 1 2 3
  + grep '^cpu MHz' /proc/cpuinfo
  cpu MHz         : 800.000
  cpu MHz         : 800.000
  + uptime
   18:12:37 up 10 min,  1 user,  load average: 0.16, 0.34, 0.34
  + yes
  + head -n10000000
  
  real    0m2.651s
  user    0m2.848s
  sys     0m0.424s

Thoughts?

-Forest
-- 
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2009-08-13 18:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-13 17:25 acpi-cpufreq; Intel Johnstown (Atom N270) Forest Bond
2009-08-13 18:29 ` Forest Bond [this message]
2009-08-13 19:07   ` Dave Jones
2009-08-13 19:09     ` Forest Bond

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090813182908.GC9385@alittletooquiet.net \
    --to=forest@alittletooquiet.net \
    --cc=linux-acpi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox