Re: [PATCH v3 1/3] idle: add support for tasks that inject idle

2016-11-24 Thread Rafael J. Wysocki
On Thu, Nov 24, 2016 at 12:04 PM, Ingo Molnar wrote: > > * Peter Zijlstra wrote: > >> On Wed, Nov 23, 2016 at 12:13:08PM -0800, Jacob Pan wrote: >> > @@ -280,6 +272,58 @@ bool cpu_in_idle(unsigned long pc) >> > pc < (unsigned long)__cpuidle_text_end; >> > } >> > >> > +static enum hrt

Re: [PATCH v3 1/3] idle: add support for tasks that inject idle

2016-11-24 Thread Ingo Molnar
* Peter Zijlstra wrote: > On Wed, Nov 23, 2016 at 12:13:08PM -0800, Jacob Pan wrote: > > @@ -280,6 +272,58 @@ bool cpu_in_idle(unsigned long pc) > > pc < (unsigned long)__cpuidle_text_end; > > } > > > > +static enum hrtimer_restart idle_inject_timer_fn(struct hrtimer *hrtimer) > >

Re: [PATCH v3 1/3] idle: add support for tasks that inject idle

2016-11-24 Thread Peter Zijlstra
On Wed, Nov 23, 2016 at 12:13:08PM -0800, Jacob Pan wrote: > @@ -280,6 +272,58 @@ bool cpu_in_idle(unsigned long pc) > pc < (unsigned long)__cpuidle_text_end; > } > > +static enum hrtimer_restart idle_inject_timer_fn(struct hrtimer *hrtimer) > +{ > + set_tsk_need_resched(curren

Re: [PATCH v3 1/3] idle: add support for tasks that inject idle

2016-11-23 Thread Ingo Molnar
* Jacob Pan wrote: > From: Peter Zijlstra > > Idle injection drivers such as Intel powerclamp and ACPI PAD drivers use > realtime tasks to take control of CPU then inject idle. There are two issues > with this approach: 'CPU' is capitalized properly here. And here: > #define PF_VCPU

[PATCH v3 1/3] idle: add support for tasks that inject idle

2016-11-23 Thread Jacob Pan
From: Peter Zijlstra Idle injection drivers such as Intel powerclamp and ACPI PAD drivers use realtime tasks to take control of CPU then inject idle. There are two issues with this approach: 1. Low efficiency: injected idle task is treated as busy so sched ticks do not stop during injected i