From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Lezcano Subject: Re: [PATCH V6] powercap/drivers/idle_injection: Add an idle injection framework Date: Fri, 15 Jun 2018 10:13:37 +0200 Message-ID: <4eaf5987-4532-5c81-ec3a-89614bf339f5@linaro.org> References: <1528804816-32636-1-git-send-email-daniel.lezcano@linaro.org> <20180612123036.GJ12180@hirez.programming.kicks-ass.net> <16d5649d-863c-10c7-9287-202568e713e6@linaro.org> <20180612125247.GO12217@hirez.programming.kicks-ass.net> <16770447-afe3-0fd7-19f9-1bd52c4c8ced@linaro.org> <20180612140654.GQ12217@hirez.programming.kicks-ass.net> <20180612155841.GT12217@hirez.programming.kicks-ass.net> <7190a58e-05f2-216c-8b36-70692fa722bf@linaro.org> <20180612173514.GV12217@hirez.programming.kicks-ass.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20180612173514.GV12217@hirez.programming.kicks-ass.net> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Peter Zijlstra Cc: viresh.kumar@linaro.org, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Eduardo Valentin , Javi Merino , Leo Yan , Kevin Wangtao , Vincent Guittot , Rui Zhang , Daniel Thompson , Andrea Parri List-Id: linux-pm@vger.kernel.org On 12/06/2018 19:35, Peter Zijlstra wrote: [ ... ] >>>> Yes, drifting is not an issue if that happens. This scheme is simpler >>>> and safer than setting the timer ahead before waking up the tasks with >>>> the risk it expires before all the tasks ended their idle cycles. >>> >>> sloppy though.. >> >> Ok, do you prefer to see the timer set in the wakeup function and thus >> having a periodic tick for the idle injection ? > > I think having a HRTIMER_RESTART handler that does hrtimer_forward() is > the most sensible. You will end up having to deal with threads not being > ready, but I think that's not a real problem. Thanks for the restartable timer suggestion. I'm finishing polishing the code and definitively the result is much more nicer. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog