linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Shi <alex.shi@intel.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: torvalds@linux-foundation.org, mingo@redhat.com,
	peterz@infradead.org, tglx@linutronix.de,
	akpm@linux-foundation.org, arjan@linux.intel.com, bp@alien8.de,
	pjt@google.com, namhyung@kernel.org, efault@gmx.de,
	vincent.guittot@linaro.org, gregkh@linuxfoundation.org,
	preeti@linux.vnet.ibm.com, viresh.kumar@linaro.org,
	linux-kernel@vger.kernel.org, "Zhang, Rui" <rui.zhang@intel.com>
Subject: Re: [patch v4 0/18] sched: simplified fork, release load avg and power awareness scheduling
Date: Tue, 05 Feb 2013 10:26:40 +0800	[thread overview]
Message-ID: <51106DE0.1060103@intel.com> (raw)
In-Reply-To: <20130204110959.GE24173@gmail.com>


>> Ingo, I appreciate for any comments from you. :)
> 
> Have you tried to quantify the actual real or expected power 
> savings with the knob enabled?

Thanks a lot for your comments! :)

Yes, the following power data copied form patch 17th:
---
A test can show the effort on different policy:
for ((i = 0; i < I; i++)) ; do while true; do :; done  &   done

On my SNB laptop with 4core* HT: the data is Watts
        powersaving     balance         performance
i = 2   40              54              54
i = 4   57              64*             68
i = 8   68              68              68

Note:
When i = 4 with balance policy, the power may change in 57~68Watt,
since the HT capacity and core capacity are both 1.

on SNB EP machine with 2 sockets * 8 cores * HT:
        powersaving     balance         performance
i = 4   190             201             238
i = 8   205             241             268
i = 16  271             348             376

If system has few continued tasks, use power policy can get
the performance/power gain. Like sysbench fileio randrw test with 16
thread on the SNB EP box.
=====

and the following from patch 18th
---
On my SNB EP 2 sockets machine with 8 cores * HT: 'make -j x vmlinux'
results:

		powersaving		balance		performance
x = 1    175.603 /417 13          175.220 /416 13        176.073 /407 13
x = 2    192.215 /218 23          194.522 /202 25        217.393 /200 23
x = 4    205.226 /124 39          208.823 /114 42        230.425 /105 41
x = 8    236.369 /71 59           249.005 /65 61         257.661 /62 62
x = 16   283.842 /48 73           307.465 /40 81         309.336 /39 82
x = 32   325.197 /32 96           333.503 /32 93         336.138 /32 92

data explains: 175.603 /417 13
	175.603: average Watts
	417: seconds(compile time)
	13:  scaled performance/power = 1000000 / seconds / watts
=====

some data for parallel compress: https://lkml.org/lkml/2012/12/11/155
---
Another testing of parallel compress with pigz on Linus' git tree.
results show we get much better performance/power with powersaving and
balance policy:

testing command:
#pigz -k -c  -p$x -r linux* &> /dev/null

On a NHM EP box
         powersaving               balance               performance
x = 4    166.516 /88 68           170.515 /82 71         165.283 /103 58
x = 8    173.654 /61 94           177.693 /60 93         172.31 /76 76

On a 2 sockets SNB EP box.
         powersaving               balance               performance
x = 4    190.995 /149 35          200.6 /129 38          208.561 /135 35
x = 8    197.969 /108 46          208.885 /103 46        213.96 /108 43
x = 16   205.163 /76 64           212.144 /91 51         229.287 /97 44

data format is: 166.516 /88 68
        166.516: average Watts
        88: seconds(compress time)
        68:  scaled performance/power = 1000000 / time / power
=====

BTW, bltk-game with openarena dropped 0.3/1.5 Watt on powersaving policy
or 0.2/0.5 Watt on balance policy on my laptop wsm/snb;
> 
> I'd also love to have an automatic policy here, with a knob that 
> has 3 values:
> 
>    0: always disabled
>    1: automatic
>    2: always enabled
> 
> here enabled/disabled is your current knob's functionality, and 
> those can also be used by user-space policy daemons/handlers.

Sure, this patch has a knob for user-space policy selecting,

$cat /sys/devices/system/cpu/sched_policy/available_sched_policy
performance powersaving balance

User can change the policy by commend 'echo':
 echo performance > /sys/devices/system/cpu/current_sched_policy

The 'performance' policy means 'always disabled' power friendly scheduling.

The 'balance/powersaving' is automatic power friendly scheduling, since
system will auto bypass power scheduling when cpus utilisation in a
sched domain is beyond the domain's cpu weight (powersaving) or beyond
the domain's capacity (balance).

There is no always enabled power scheduling, since the patchset bases on
'race to idle'. but it's easy to add this function if needed.

> 
> The interesting thing would be '1' which should be the default: 
> on laptops that are on battery it should result in a power 
> saving policy, on laptops that are on AC or on battery-less 
> systems it should mean 'performance' policy.

yes, with above sysfs interface it is easy to be done. :)
> 
> It should generally default to 'performance', switching to 
> 'power saving on' only if there's positive, reliable information 
> somewhere in the kernel that we are operating on battery power. 
> A callback or two would have to go into the ACPI battery driver 
> I suspect.
> 
> So I'd like this feature to be a tangible improvement for laptop 
> users (as long as the laptop hardware is passing us battery/AC 
> events reliably).

Maybe it is better to let system admin change it from user space? I am
not sure some one like to enable a call back in ACPI battery driver?

CC to Zhang Rui.
> 
> Or something like that - with .config switches to influence 
> these values as well.
> 
> Thanks,
> 
> 	Ingo
> 


-- 
Thanks Alex

  reply	other threads:[~2013-02-05  2:26 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-24  3:06 [patch v4 0/18] sched: simplified fork, release load avg and power awareness scheduling Alex Shi
2013-01-24  3:06 ` [patch v4 01/18] sched: set SD_PREFER_SIBLING on MC domain to reduce a domain level Alex Shi
2013-02-12 10:11   ` Peter Zijlstra
2013-02-13 13:22     ` Alex Shi
2013-02-15 12:38       ` Peter Zijlstra
2013-02-16  5:16         ` Alex Shi
2013-02-13 14:17     ` Alex Shi
2013-01-24  3:06 ` [patch v4 02/18] sched: select_task_rq_fair clean up Alex Shi
2013-02-12 10:14   ` Peter Zijlstra
2013-02-13 14:44     ` Alex Shi
2013-01-24  3:06 ` [patch v4 03/18] sched: fix find_idlest_group mess logical Alex Shi
2013-02-12 10:16   ` Peter Zijlstra
2013-02-13 15:07     ` Alex Shi
2013-01-24  3:06 ` [patch v4 04/18] sched: don't need go to smaller sched domain Alex Shi
2013-01-24  3:06 ` [patch v4 05/18] sched: quicker balancing on fork/exec/wake Alex Shi
2013-02-12 10:22   ` Peter Zijlstra
2013-02-14  3:13     ` Alex Shi
2013-02-14  8:12     ` Preeti U Murthy
2013-02-14 14:08       ` Alex Shi
2013-02-15 13:00       ` Peter Zijlstra
2013-01-24  3:06 ` [patch v4 06/18] sched: give initial value for runnable avg of sched entities Alex Shi
2013-02-12 10:23   ` Peter Zijlstra
2013-01-24  3:06 ` [patch v4 07/18] sched: set initial load avg of new forked task Alex Shi
2013-02-12 10:26   ` Peter Zijlstra
2013-02-13 15:14     ` Alex Shi
2013-02-13 15:41       ` Paul Turner
2013-02-14 13:07         ` Alex Shi
2013-02-19 11:34           ` Paul Turner
2013-02-20  4:18             ` Preeti U Murthy
2013-02-20  5:13             ` Alex Shi
2013-01-24  3:06 ` [patch v4 08/18] Revert "sched: Introduce temporary FAIR_GROUP_SCHED dependency for load-tracking" Alex Shi
2013-02-12 10:27   ` Peter Zijlstra
2013-02-13 15:23     ` Alex Shi
2013-02-13 15:45       ` Paul Turner
2013-02-14  3:07         ` Preeti U Murthy
2013-01-24  3:06 ` [patch v4 09/18] sched: add sched_policies in kernel Alex Shi
2013-02-12 10:36   ` Peter Zijlstra
2013-02-13 15:41     ` Alex Shi
2013-01-24  3:06 ` [patch v4 10/18] sched: add sysfs interface for sched_policy selection Alex Shi
2013-01-24  3:06 ` [patch v4 11/18] sched: log the cpu utilization at rq Alex Shi
2013-02-12 10:39   ` Peter Zijlstra
2013-02-14  3:10     ` Alex Shi
2013-01-24  3:06 ` [patch v4 12/18] sched: add power aware scheduling in fork/exec/wake Alex Shi
2013-01-24  3:06 ` [patch v4 13/18] sched: packing small tasks in wake/exec balancing Alex Shi
2013-01-24  3:06 ` [patch v4 14/18] sched: add power/performance balance allowed flag Alex Shi
2013-01-24  3:06 ` [patch v4 15/18] sched: pull all tasks from source group Alex Shi
2013-01-24  3:06 ` [patch v4 16/18] sched: don't care if the local group has capacity Alex Shi
2013-01-24  3:06 ` [patch v4 17/18] sched: power aware load balance, Alex Shi
2013-01-24  3:07 ` [patch v4 18/18] sched: lazy power balance Alex Shi
2013-01-24  9:44 ` [patch v4 0/18] sched: simplified fork, release load avg and power awareness scheduling Borislav Petkov
2013-01-24 15:07   ` Alex Shi
2013-01-27  2:41     ` Alex Shi
2013-01-27  4:36       ` Mike Galbraith
2013-01-27 10:35         ` Borislav Petkov
2013-01-27 13:25           ` Alex Shi
2013-01-27 15:51             ` Mike Galbraith
2013-01-28  5:17               ` Mike Galbraith
2013-01-28  5:51                 ` Alex Shi
2013-01-28  6:15                   ` Mike Galbraith
2013-01-28  6:42                     ` Mike Galbraith
2013-01-28  7:20                       ` Mike Galbraith
2013-01-29  1:17                       ` Alex Shi
2013-01-28  9:55                 ` Borislav Petkov
2013-01-28 10:44                   ` Mike Galbraith
2013-01-28 11:29                     ` Borislav Petkov
2013-01-28 11:32                       ` Mike Galbraith
2013-01-28 11:40                         ` Mike Galbraith
2013-01-28 15:22                           ` Borislav Petkov
2013-01-28 15:55                             ` Mike Galbraith
2013-01-29  1:38                               ` Alex Shi
2013-01-29  1:32                         ` Alex Shi
2013-01-29  1:36                       ` Alex Shi
2013-01-28 15:47                 ` Mike Galbraith
2013-01-29  1:45                   ` Alex Shi
2013-01-29  4:03                     ` Mike Galbraith
2013-01-29  2:27                   ` Alex Shi
2013-01-27 10:40       ` Borislav Petkov
2013-01-27 14:03         ` Alex Shi
2013-01-28  5:19         ` Alex Shi
2013-01-28  6:49           ` Mike Galbraith
2013-01-28  7:17             ` Alex Shi
2013-01-28  7:33               ` Mike Galbraith
2013-01-29  6:02           ` Alex Shi
2013-01-28  1:28 ` Alex Shi
2013-02-04  1:35 ` Alex Shi
2013-02-04 11:09   ` Ingo Molnar
2013-02-05  2:26     ` Alex Shi [this message]
2013-02-06  5:08       ` Alex Shi

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=51106DE0.1060103@intel.com \
    --to=alex.shi@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=efault@gmx.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=preeti@linux.vnet.ibm.com \
    --cc=rui.zhang@intel.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=vincent.guittot@linaro.org \
    --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;
as well as URLs for NNTP newsgroup(s).