Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-21 Thread Alex Shi
On 02/21/2013 05:42 PM, Borislav Petkov wrote: > On Thu, Feb 21, 2013 at 09:32:54AM +0800, Alex Shi wrote: >> Yes, use flags can save 2 int variable, I will change that. >> >> Just curious, consider the lb_env size and just used in stack, plus >> the big cacheline size of modern cpu, and the

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-21 Thread Borislav Petkov
On Thu, Feb 21, 2013 at 09:32:54AM +0800, Alex Shi wrote: > Yes, use flags can save 2 int variable, I will change that. > > Just curious, consider the lb_env size and just used in stack, plus > the big cacheline size of modern cpu, and the alignment of gcc flag on > kernel, seems no arch needs

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-21 Thread Borislav Petkov
On Thu, Feb 21, 2013 at 09:32:54AM +0800, Alex Shi wrote: Yes, use flags can save 2 int variable, I will change that. Just curious, consider the lb_env size and just used in stack, plus the big cacheline size of modern cpu, and the alignment of gcc flag on kernel, seems no arch needs more

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-21 Thread Alex Shi
On 02/21/2013 05:42 PM, Borislav Petkov wrote: On Thu, Feb 21, 2013 at 09:32:54AM +0800, Alex Shi wrote: Yes, use flags can save 2 int variable, I will change that. Just curious, consider the lb_env size and just used in stack, plus the big cacheline size of modern cpu, and the alignment of

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Alex Shi
On 02/20/2013 11:22 PM, Borislav Petkov wrote: > On Wed, Feb 20, 2013 at 10:20:19PM +0800, Alex Shi wrote: > >> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > >> index 2e8131d..0047856 100644 > >> --- a/kernel/sched/fair.c > >> +++ b/kernel/sched/fair.c > >> @@

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Borislav Petkov
On Wed, Feb 20, 2013 at 10:20:19PM +0800, Alex Shi wrote: > >> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > >> index 2e8131d..0047856 100644 > >> --- a/kernel/sched/fair.c > >> +++ b/kernel/sched/fair.c > >> @@ -4053,6 +4053,8 @@ struct lb_env { > >>unsigned intloop; >

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Alex Shi
>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c >> index 2e8131d..0047856 100644 >> --- a/kernel/sched/fair.c >> +++ b/kernel/sched/fair.c >> @@ -4053,6 +4053,8 @@ struct lb_env { >> unsigned intloop; >> unsigned intloop_break; >> unsigned int

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Alex Shi
>>> (power_lb == 1 && perf_lb == 1) is incorrect and impossible to have. >>> >>> (power_lb == 0 && perf_lb == 0) is possible and it means there is no any >>> balance on this cpu. >>> >>> So, enumeration is not enough. >> >> Huh.. both 0 doesn't make any sense either. If there's no balancing, we

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Alex Shi
On 02/20/2013 09:37 PM, Peter Zijlstra wrote: > On Wed, 2013-02-20 at 20:04 +0800, Alex Shi wrote: > @@ -5195,6 +5197,8 @@ static int load_balance(int this_cpu, struct rq *this_rq, .idle = idle, .loop_break =

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Peter Zijlstra
On Wed, 2013-02-20 at 14:37 +0100, Peter Zijlstra wrote: > On Wed, 2013-02-20 at 20:04 +0800, Alex Shi wrote: > > > >> @@ -5195,6 +5197,8 @@ static int load_balance(int this_cpu, struct rq > > >> *this_rq, > > >> .idle = idle, > > >> .loop_break =

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Peter Zijlstra
On Wed, 2013-02-20 at 20:04 +0800, Alex Shi wrote: > >> @@ -5195,6 +5197,8 @@ static int load_balance(int this_cpu, struct rq > >> *this_rq, > >> .idle = idle, > >> .loop_break = sched_nr_migrate_break, > >> .cpus = cpus, >

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Borislav Petkov
On Mon, Feb 18, 2013 at 01:07:38PM +0800, Alex Shi wrote: > If a sched domain is idle enough for regular power balance, power_lb > will be set, perf_lb will be clean. If a sched domain is busy, > their value will be set oppositely. > > If the domain is suitable for power balance, but balance

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Alex Shi
On 02/20/2013 05:48 PM, Peter Zijlstra wrote: > On Mon, 2013-02-18 at 13:07 +0800, Alex Shi wrote: >> @@ -4053,6 +4053,8 @@ struct lb_env { >> unsigned intloop; >> unsigned intloop_break; >> unsigned intloop_max; >> + int

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Peter Zijlstra
On Mon, 2013-02-18 at 13:07 +0800, Alex Shi wrote: > @@ -4053,6 +4053,8 @@ struct lb_env { > unsigned intloop; > unsigned intloop_break; > unsigned intloop_max; > + int power_lb; /* if power balance needed > */

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Peter Zijlstra
On Mon, 2013-02-18 at 13:07 +0800, Alex Shi wrote: @@ -4053,6 +4053,8 @@ struct lb_env { unsigned intloop; unsigned intloop_break; unsigned intloop_max; + int power_lb; /* if power balance needed */ +

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Alex Shi
On 02/20/2013 05:48 PM, Peter Zijlstra wrote: On Mon, 2013-02-18 at 13:07 +0800, Alex Shi wrote: @@ -4053,6 +4053,8 @@ struct lb_env { unsigned intloop; unsigned intloop_break; unsigned intloop_max; + int

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Borislav Petkov
On Mon, Feb 18, 2013 at 01:07:38PM +0800, Alex Shi wrote: If a sched domain is idle enough for regular power balance, power_lb will be set, perf_lb will be clean. If a sched domain is busy, their value will be set oppositely. If the domain is suitable for power balance, but balance should

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Peter Zijlstra
On Wed, 2013-02-20 at 20:04 +0800, Alex Shi wrote: @@ -5195,6 +5197,8 @@ static int load_balance(int this_cpu, struct rq *this_rq, .idle = idle, .loop_break = sched_nr_migrate_break, .cpus = cpus, +

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Peter Zijlstra
On Wed, 2013-02-20 at 14:37 +0100, Peter Zijlstra wrote: On Wed, 2013-02-20 at 20:04 +0800, Alex Shi wrote: @@ -5195,6 +5197,8 @@ static int load_balance(int this_cpu, struct rq *this_rq, .idle = idle, .loop_break =

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Alex Shi
On 02/20/2013 09:37 PM, Peter Zijlstra wrote: On Wed, 2013-02-20 at 20:04 +0800, Alex Shi wrote: @@ -5195,6 +5197,8 @@ static int load_balance(int this_cpu, struct rq *this_rq, .idle = idle, .loop_break = sched_nr_migrate_break,

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Alex Shi
(power_lb == 1 perf_lb == 1) is incorrect and impossible to have. (power_lb == 0 perf_lb == 0) is possible and it means there is no any balance on this cpu. So, enumeration is not enough. Huh.. both 0 doesn't make any sense either. If there's no balancing, we shouldn't be here to begin

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Alex Shi
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 2e8131d..0047856 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4053,6 +4053,8 @@ struct lb_env { unsigned intloop; unsigned intloop_break; unsigned intloop_max;

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Borislav Petkov
On Wed, Feb 20, 2013 at 10:20:19PM +0800, Alex Shi wrote: diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 2e8131d..0047856 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4053,6 +4053,8 @@ struct lb_env { unsigned intloop; unsigned int

Re: [patch v5 11/15] sched: add power/performance balance allow flag

2013-02-20 Thread Alex Shi
On 02/20/2013 11:22 PM, Borislav Petkov wrote: On Wed, Feb 20, 2013 at 10:20:19PM +0800, Alex Shi wrote: diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 2e8131d..0047856 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4053,6 +4053,8 @@ struct lb_env {

[patch v5 11/15] sched: add power/performance balance allow flag

2013-02-17 Thread Alex Shi
If a sched domain is idle enough for regular power balance, power_lb will be set, perf_lb will be clean. If a sched domain is busy, their value will be set oppositely. If the domain is suitable for power balance, but balance should not be down by this cpu(this cpu is already idle or full), both

[patch v5 11/15] sched: add power/performance balance allow flag

2013-02-17 Thread Alex Shi
If a sched domain is idle enough for regular power balance, power_lb will be set, perf_lb will be clean. If a sched domain is busy, their value will be set oppositely. If the domain is suitable for power balance, but balance should not be down by this cpu(this cpu is already idle or full), both