From: Stratos Karafotis <stratosk@semaphore.gr>
To: "Rafael J. Wysocki" <rjw@sisk.pl>, Borislav Petkov <bp@suse.de>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
linux-pm@vger.kernel.org, cpufreq@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/3] cpufreq: ondemand: Change the calculation of target frequency
Date: Fri, 07 Jun 2013 22:14:34 +0300 [thread overview]
Message-ID: <51B2311A.9040308@semaphore.gr> (raw)
In-Reply-To: <105446113.ZumbZWCbSi@vostro.rjw.lan>
On 06/05/2013 11:35 PM, Rafael J. Wysocki wrote:
> On Wednesday, June 05, 2013 08:13:26 PM Stratos Karafotis wrote:
>> Hi Borislav,
>>
>> On 06/05/2013 07:17 PM, Borislav Petkov wrote:
>>> On Wed, Jun 05, 2013 at 07:01:25PM +0300, Stratos Karafotis wrote:
>>>> Ondemand calculates load in terms of frequency and increases it only
>>>> if the load_freq is greater than up_threshold multiplied by current
>>>> or average frequency. This seems to produce oscillations of frequency
>>>> between min and max because, for example, a relatively small load can
>>>> easily saturate minimum frequency and lead the CPU to max. Then, the
>>>> CPU will decrease back to min due to a small load_freq.
>>>
>>> Right, and I think this is how we want it, no?
>>>
>>> The thing is, the faster you finish your work, the faster you can become
>>> idle and save power.
>>
>> This is exactly the goal of this patch. To use more efficiently middle
>> frequencies to finish faster the work.
>>
>>> If you switch frequencies in a staircase-like manner, you're going to
>>> take longer to finish, in certain cases, and burn more power while doing
>>> so.
>>
>> This is not true with this patch. It switches to middle frequencies
>> when the load < up_threshold.
>> Now, ondemand does not increase freq. CPU runs in lowest freq till the
>> load is greater than up_threshold.
>>
>>> Btw, racing to idle is also a good example for why you want boosting:
>>> you want to go max out the core but stay within power limits so that you
>>> can finish sooner.
>>>
>>>> This patch changes the calculation method of load and target frequency
>>>> considering 2 points:
>>>> - Load computation should be independent from current or average
>>>> measured frequency. For example an absolute load 80% at 100MHz is not
>>>> necessarily equivalent to 8% at 1000MHz in the next sampling interval.
>>>> - Target frequency should be increased to any value of frequency table
>>>> proportional to absolute load, instead to only the max. Thus:
>>>>
>>>> Target frequency = C * load
>>>>
>>>> where C = policy->cpuinfo.max_freq / 100
>>>>
>>>> Tested on Intel i7-3770 CPU @ 3.40GHz and on Quad core 1500MHz Krait.
>>>> Phoronix benchmark of Linux Kernel Compilation 3.1 test shows an
>>>> increase ~1.5% in performance. cpufreq_stats (time_in_state) shows
>>>> that middle frequencies are used more, with this patch. Highest
>>>> and lowest frequencies were used less by ~9%
>
> Can you also use powertop to measure the percentage of time spent in idle
> states for the same workload with and without your patchset? Also, it would
> be good to measure the total energy consumption somehow ...
>
> Thanks,
> Rafael
Hi Rafael,
I repeated the tests extracting also powertop results.
Measurement steps with and without this patch:
1) Reboot system
2) Running twice Phoronix benchmark of Linux Kernel Compilation 3.1 test
without taking measurement
3) Wait few minutes
4) Run Phoronix and powertop for 100secs and take measurement.
I will try to repeat the test and take measurements with turbostat as
Borislav suggested.
Thanks,
Stratos
------------------------------------------------------------------
Test WITHOUT this patch:
Phoronix Test Suite v4.6.0
Installed: pts/build-linux-kernel-1.3.0
System Information
Hardware:
Processor: Intel Core i7-3770 @ 3.40GHz (8 Cores), Motherboard: ASUS CM6870, Chipset: Intel Xeon E3-1200 v2/3rd, Memory: 2 x 4096 MB DDR3-1600MHz HY64C1C1624ZY, Disk: 1000GB Seagate ST1000DM003-9YN1, Graphics: NVIDIA GeForce GT 640 3072MB, Audio: Realtek ALC892, Monitor: S23B350, Network: Realtek RTL8111/8168 + Ralink RT3090 Wireless 802.11n 1T/1R
Software:
OS: Fedora 18, Kernel: 3.10.0-rc3v+ (x86_64), Desktop: KDE 4.10.3, Display Server: X Server 1.13.3, Display Driver: nouveau 1.0.7, File-System: ext4, Screen Resolution: 1920x1080
Would you like to save these test results (Y/n): n
Timed Linux Kernel Compilation 3.1:
pts/build-linux-kernel-1.3.0
Test 1 of 1
Estimated Trial Run Count: 3
Estimated Time To Completion: 2 Minutes
Running Pre-Test Script @ 21:41:19
Started Run 1 @ 21:41:30
Running Interim Test Script @ 21:41:44
Started Run 2 @ 21:41:47
Running Interim Test Script @ 21:42:02
Started Run 3 @ 21:42:05
Running Interim Test Script @ 21:42:15 [Std. Dev: 19.28%]
Started Run 4 @ 21:42:19
Running Interim Test Script @ 21:42:29 [Std. Dev: 18.72%]
Started Run 5 @ 21:42:32
Running Interim Test Script @ 21:42:42 [Std. Dev: 17.84%]
Started Run 6 @ 21:42:46 [Std. Dev: 16.91%]
Running Post-Test Script @ 21:42:55
Test Results:
11.073544979095
14.059958934784
9.6814110279083
9.6158590316772
9.5762379169464
9.5944919586182
Average: 10.60 Seconds
Powertop results:
http://www.semaphore.gr/results/powertop_without.html
---------------------------------------------------------------------
Test WITH this patch:
Phoronix Test Suite v4.6.0
Installed: pts/build-linux-kernel-1.3.0
System Information
Hardware:
Processor: Intel Core i7-3770 @ 3.40GHz (8 Cores), Motherboard: ASUS CM6870, Chipset: Intel Xeon E3-1200 v2/3rd, Memory: 2 x 4096 MB DDR3-1600MHz HY64C1C1624ZY, Disk: 1000GB Seagate ST1000DM003-9YN1, Graphics: NVIDIA GeForce GT 640 3072MB, Audio: Realtek ALC892, Monitor: S23B350, Network: Realtek RTL8111/8168 + Ralink RT3090 Wireless 802.11n 1T/1R
Software:
OS: Fedora 18, Kernel: 3.10.0-rc3+ (x86_64), Desktop: KDE 4.10.3, Display Server: X Server 1.13.3, Display Driver: nouveau 1.0.7, File-System: ext4, Screen Resolution: 1920x1080
Would you like to save these test results (Y/n): n
Timed Linux Kernel Compilation 3.1:
pts/build-linux-kernel-1.3.0
Test 1 of 1
Estimated Trial Run Count: 3
Estimated Time To Completion: 2 Minutes
Running Pre-Test Script @ 21:28:05
Started Run 1 @ 21:28:17
Running Interim Test Script @ 21:28:30
Started Run 2 @ 21:28:34
Running Interim Test Script @ 21:28:44
Started Run 3 @ 21:28:47
Running Interim Test Script @ 21:28:58 [Std. Dev: 4.81%]
Started Run 4 @ 21:29:02
Running Interim Test Script @ 21:29:12 [Std. Dev: 6.05%]
Started Run 5 @ 21:29:15
Running Interim Test Script @ 21:29:25 [Std. Dev: 6.13%]
Started Run 6 @ 21:29:28 [Std. Dev: 6.02%]
Running Post-Test Script @ 21:29:38
Test Results:
10.442322015762
10.038927078247
11.044027090073
9.5781810283661
9.5812470912933
9.5545389652252
Average: 10.04 Seconds
Powertop results:
http://www.semaphore.gr/results/powertop_with.html
next prev parent reply other threads:[~2013-06-07 19:14 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-05 16:01 [PATCH v3 1/3] cpufreq: ondemand: Change the calculation of target frequency Stratos Karafotis
2013-06-05 16:17 ` Borislav Petkov
2013-06-05 16:58 ` David C Niemi
2013-06-06 9:55 ` Borislav Petkov
2013-06-06 9:57 ` Viresh Kumar
2013-06-06 13:50 ` David C Niemi
2013-06-05 17:13 ` Stratos Karafotis
2013-06-05 20:35 ` Rafael J. Wysocki
2013-06-06 10:01 ` Borislav Petkov
2013-06-06 10:10 ` Viresh Kumar
2013-06-06 12:10 ` Borislav Petkov
2013-06-06 16:46 ` Stratos Karafotis
2013-06-06 17:11 ` Borislav Petkov
2013-06-06 17:32 ` Stratos Karafotis
2013-06-07 19:14 ` Stratos Karafotis [this message]
2013-06-07 20:57 ` Rafael J. Wysocki
2013-06-08 9:56 ` Stratos Karafotis
2013-06-08 11:18 ` Rafael J. Wysocki
-- strict thread matches above, loose matches on Subject: below --
2013-06-06 12:54 Stratos Karafotis
2013-06-06 13:15 ` Borislav Petkov
2013-06-06 12:56 Stratos Karafotis
2013-06-08 12:34 Stratos Karafotis
2013-06-08 14:05 ` Rafael J. Wysocki
2013-06-08 20:31 ` Stratos Karafotis
2013-06-08 22:18 ` Rafael J. Wysocki
2013-06-09 16:26 ` Borislav Petkov
2013-06-09 18:08 ` Stratos Karafotis
2013-06-09 20:58 ` Rafael J. Wysocki
2013-06-09 21:14 ` Borislav Petkov
2013-06-09 22:11 ` Rafael J. Wysocki
2015-02-23 16:42 ` nitin
2013-06-10 21:57 ` Stratos Karafotis
2013-06-10 23:24 ` Rafael J. Wysocki
2013-06-13 21:22 ` Stratos Karafotis
2013-06-13 21:40 ` Borislav Petkov
2013-06-13 22:04 ` Stratos Karafotis
2013-06-13 22:38 ` Borislav Petkov
2013-06-13 22:15 ` Rafael J. Wysocki
2013-06-13 22:37 ` Borislav Petkov
2013-06-14 12:46 ` Rafael J. Wysocki
2013-06-14 12:44 ` Borislav Petkov
2013-06-14 12:55 ` Rafael J. Wysocki
2013-06-14 15:53 ` Stratos Karafotis
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=51B2311A.9040308@semaphore.gr \
--to=stratosk@semaphore.gr \
--cc=bp@suse.de \
--cc=cpufreq@vger.kernel.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rjw@sisk.pl \
--cc=tglx@linutronix.de \
--cc=viresh.kumar@linaro.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