Re: [RFC PATCH] sched: find the latest idle cpu

2014-01-16 Thread Nicolas Pitre
On Thu, 16 Jan 2014, Daniel Lezcano wrote: > The question raised when I looked closely how to fully integrate cpuidle with > the scheduler; in particular, the idle time. > The scheduler idle time is not the same than the cpuidle idle time. > A cpu can be idle for the scheduler 1s but it could be i

Re: [RFC PATCH] sched: find the latest idle cpu

2014-01-16 Thread Daniel Lezcano
On 01/16/2014 12:38 PM, Peter Zijlstra wrote: On Thu, Jan 16, 2014 at 12:03:13PM +0100, Daniel Lezcano wrote: Hi Alex, it is a nice optimization attempt but I agree with Peter we should focus on integrating cpuidle. The question is "how do we integrate cpuidle ?" IMHO, the main problem are th

Re: [RFC PATCH] sched: find the latest idle cpu

2014-01-16 Thread Peter Zijlstra
On Thu, Jan 16, 2014 at 12:03:13PM +0100, Daniel Lezcano wrote: > Hi Alex, > > it is a nice optimization attempt but I agree with Peter we should focus on > integrating cpuidle. > > The question is "how do we integrate cpuidle ?" > > IMHO, the main problem are the governors, especially the menu

Re: [RFC PATCH] sched: find the latest idle cpu

2014-01-16 Thread Daniel Lezcano
On 01/15/2014 03:37 PM, Alex Shi wrote: On 01/15/2014 03:35 PM, Peter Zijlstra wrote: On Wed, Jan 15, 2014 at 12:07:59PM +0800, Alex Shi wrote: Currently we just try to find least load cpu. If some cpus idled, we just pick the first cpu in cpu mask. In fact we can get the interrupted idle cpu

Re: [RFC PATCH] sched: find the latest idle cpu

2014-01-15 Thread Alex Shi
On 01/15/2014 03:35 PM, Peter Zijlstra wrote: > On Wed, Jan 15, 2014 at 12:07:59PM +0800, Alex Shi wrote: >> Currently we just try to find least load cpu. If some cpus idled, >> we just pick the first cpu in cpu mask. >> >> In fact we can get the interrupted idle cpu or the latest idled cpu, >> the

Re: [RFC PATCH] sched: find the latest idle cpu

2014-01-15 Thread Alex Shi
On 01/15/2014 04:05 PM, Michael wang wrote: > On 01/15/2014 02:45 PM, Alex Shi wrote: > [snip] >> >> yes, to save your scenario, we need to know the next timer for idle cpu, >> but that is not enough, interrupt is totally unpredictable. So, I'd >> rather bear the coarse method now. >>> >>> So what

Re: [RFC PATCH] sched: find the latest idle cpu

2014-01-15 Thread Michael wang
On 01/15/2014 02:45 PM, Alex Shi wrote: [snip] > > yes, to save your scenario, we need to know the next timer for idle cpu, > but that is not enough, interrupt is totally unpredictable. So, I'd > rather bear the coarse method now. >> >> So what about just check 'ts->tick_stopped' and record one ti

Re: [RFC PATCH] sched: find the latest idle cpu

2014-01-14 Thread Peter Zijlstra
On Wed, Jan 15, 2014 at 12:07:59PM +0800, Alex Shi wrote: > Currently we just try to find least load cpu. If some cpus idled, > we just pick the first cpu in cpu mask. > > In fact we can get the interrupted idle cpu or the latest idled cpu, > then we may get the benefit from both latency and power

Re: [RFC PATCH] sched: find the latest idle cpu

2014-01-14 Thread Alex Shi
On 01/15/2014 01:33 PM, Michael wang wrote: > On 01/15/2014 12:07 PM, Alex Shi wrote: >> > Currently we just try to find least load cpu. If some cpus idled, >> > we just pick the first cpu in cpu mask. >> > >> > In fact we can get the interrupted idle cpu or the latest idled cpu, >> > then we may

Re: [RFC PATCH] sched: find the latest idle cpu

2014-01-14 Thread Michael wang
On 01/15/2014 12:07 PM, Alex Shi wrote: > Currently we just try to find least load cpu. If some cpus idled, > we just pick the first cpu in cpu mask. > > In fact we can get the interrupted idle cpu or the latest idled cpu, > then we may get the benefit from both latency and power. > The selected c

Re: [RFC PATCH] sched: find the latest idle cpu

2014-01-14 Thread Alex Shi
On 01/15/2014 12:53 PM, Alex Shi wrote: >>> >> I guess we missed some code for latest_wake here? >> > >> > Yes, thanks for reminder! >> > >> > so updated patch: >> > > ops, still incorrect. re-updated: update to wrong file. re-re-update. :( === >From b75e43bb77df14e2209532c1e5c48e0e03afa414 M

Re: [RFC PATCH] sched: find the latest idle cpu

2014-01-14 Thread Alex Shi
On 01/15/2014 12:48 PM, Alex Shi wrote: > On 01/15/2014 12:31 PM, Michael wang wrote: >> Hi, Alex >> >> On 01/15/2014 12:07 PM, Alex Shi wrote: >> [snip] } >>> +#ifdef CONFIG_NO_HZ_COMMON >>> + /* >>> +* Coarsely to get the latest idle cpu for shorter latency and

Re: [RFC PATCH] sched: find the latest idle cpu

2014-01-14 Thread Alex Shi
On 01/15/2014 12:31 PM, Michael wang wrote: > Hi, Alex > > On 01/15/2014 12:07 PM, Alex Shi wrote: > [snip]} >> +#ifdef CONFIG_NO_HZ_COMMON >> +/* >> + * Coarsely to get the latest idle cpu for shorter latency and >> + * possible power benefit. >

Re: [RFC PATCH] sched: find the latest idle cpu

2014-01-14 Thread Michael wang
Hi, Alex On 01/15/2014 12:07 PM, Alex Shi wrote: [snip] } > +#ifdef CONFIG_NO_HZ_COMMON > + /* > + * Coarsely to get the latest idle cpu for shorter latency and > + * possible power benefit. > + */ > + if (!min_load) { > +

[RFC PATCH] sched: find the latest idle cpu

2014-01-14 Thread Alex Shi
Currently we just try to find least load cpu. If some cpus idled, we just pick the first cpu in cpu mask. In fact we can get the interrupted idle cpu or the latest idled cpu, then we may get the benefit from both latency and power. The selected cpu maybe not the best, since other cpu may be interr