Re: [PATCH V4] powercap/drivers/idle_injection: Add an idle injection framework

2018-06-05 Thread Viresh Kumar
On 05-06-18, 08:53, Daniel Lezcano wrote: > On 05/06/2018 07:53, Viresh Kumar wrote: > > On 05-06-18, 07:48, Daniel Lezcano wrote: > >> As soon as we reach complete(), no timer can be set because of the > >> condition before. > > > > Why not ? We aren't using any locks here and it is possible that

Re: [PATCH V4] powercap/drivers/idle_injection: Add an idle injection framework

2018-06-04 Thread Daniel Lezcano
On 05/06/2018 07:53, Viresh Kumar wrote: > On 05-06-18, 07:48, Daniel Lezcano wrote: >> As soon as we reach complete(), no timer can be set because of the >> condition before. > > Why not ? We aren't using any locks here and it is possible that > run_duration_ms > is set to 0 from idle_injection_

Re: [PATCH V4] powercap/drivers/idle_injection: Add an idle injection framework

2018-06-04 Thread Viresh Kumar
On 05-06-18, 07:48, Daniel Lezcano wrote: > As soon as we reach complete(), no timer can be set because of the > condition before. Why not ? We aren't using any locks here and it is possible that run_duration_ms is set to 0 from idle_injection_stop() only after the first thread has restarted the h

Re: [PATCH V4] powercap/drivers/idle_injection: Add an idle injection framework

2018-06-04 Thread Daniel Lezcano
On 05/06/2018 07:14, Viresh Kumar wrote: > On 31-05-18, 20:25, Daniel Lezcano wrote: >> On 29/05/2018 11:31, Viresh Kumar wrote: >>> On 25-05-18, 11:49, Daniel Lezcano wrote: + /* + * The last CPU waking up is in charge of setting the timer. If + * the CPU is hotplugged, the

Re: [PATCH V4] powercap/drivers/idle_injection: Add an idle injection framework

2018-06-04 Thread Viresh Kumar
On 31-05-18, 20:25, Daniel Lezcano wrote: > On 29/05/2018 11:31, Viresh Kumar wrote: > > On 25-05-18, 11:49, Daniel Lezcano wrote: > >> + /* > >> + * The last CPU waking up is in charge of setting the timer. If > >> + * the CPU is hotplugged, the timer will move to another CPU > >> + * (whic

Re: [PATCH V4] powercap/drivers/idle_injection: Add an idle injection framework

2018-05-31 Thread Daniel Lezcano
On 29/05/2018 11:31, Viresh Kumar wrote: > Hi Daniel, > > Thanks for yet another version :) > > On 25-05-18, 11:49, Daniel Lezcano wrote: >> +++ b/drivers/powercap/idle_injection.c >> +static void idle_injection_wakeup(struct idle_injection_device *ii_dev) >> +{ >> +struct idle_injection_thre

Re: [PATCH V4] powercap/drivers/idle_injection: Add an idle injection framework

2018-05-29 Thread Viresh Kumar
Hi Daniel, Thanks for yet another version :) On 25-05-18, 11:49, Daniel Lezcano wrote: > +++ b/drivers/powercap/idle_injection.c > +static void idle_injection_wakeup(struct idle_injection_device *ii_dev) > +{ > + struct idle_injection_thread *iit; > + int cpu; > + > + for_each_cpu_and

[PATCH V4] powercap/drivers/idle_injection: Add an idle injection framework

2018-05-25 Thread Daniel Lezcano
Initially, the cpu_cooling device for ARM was changed by adding a new policy inserting idle cycles. The intel_powerclamp driver does a similar action. Instead of implementing idle injections privately in the cpu_cooling device, move the idle injection code in a dedicated framework and give the opp