From: Peter Zijlstra <peterz@infradead.org>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: viresh.kumar@linaro.org, rjw@rjwysocki.net,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
Eduardo Valentin <edubezval@gmail.com>,
Javi Merino <javi.merino@kernel.org>,
Leo Yan <leo.yan@linaro.org>,
Kevin Wangtao <kevin.wangtao@linaro.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Rui Zhang <rui.zhang@intel.com>,
Daniel Thompson <daniel.thompson@linaro.org>,
Andrea Parri <andrea.parri@amarulasolutions.com>
Subject: Re: [PATCH V6] powercap/drivers/idle_injection: Add an idle injection framework
Date: Tue, 12 Jun 2018 19:35:14 +0200 [thread overview]
Message-ID: <20180612173514.GV12217@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <7190a58e-05f2-216c-8b36-70692fa722bf@linaro.org>
On Tue, Jun 12, 2018 at 07:02:57PM +0200, Daniel Lezcano wrote:
> Mmh, it is unclear for me if the park() vs wakeup() can happen at the
> same time.
>
> If the park() function is called, that means the hotplug is allowed.
No, it means we're inside hot-un-plug, but that doesn't stop the hrtimer
from firing.
> If the hotplug is allowed, we can modify the online mask.
>
> What happens with the online mask when we are processing it in an
> interrupt context ?
RCU-like, if you observe a CPU in the online mask, it will stay
available, but the bit might get cleared.
> > Maybe avoid the issue entire by having a
> > {period,idle} tuple, where your old run := period - idle.
>
> Can you elaborate ? I don't get it.
Have a period parameter that specifies the interval in which you have
one injected idle, and specify for how long you want to inject idle;
then obviously idle < period.
> >>> Furthermore, should you not be using hrtimer_forward(&timer,
> >>> idle_duration + run_duration) instead? AFAICT the current scheme is
> >>> prone to drifting.
> >>
> >> (I assume you meant setting the timer in the wakeup task function).
> >>
> >> 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.
next prev parent reply other threads:[~2018-06-12 17:35 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-12 12:00 [PATCH V6] powercap/drivers/idle_injection: Add an idle injection framework Daniel Lezcano
2018-06-12 12:30 ` Peter Zijlstra
2018-06-12 12:44 ` Daniel Lezcano
2018-06-12 12:52 ` Peter Zijlstra
2018-06-12 13:02 ` Daniel Lezcano
2018-06-12 14:06 ` Peter Zijlstra
2018-06-12 14:37 ` Daniel Lezcano
2018-06-12 15:58 ` Peter Zijlstra
2018-06-12 17:02 ` Daniel Lezcano
2018-06-12 17:35 ` Peter Zijlstra [this message]
2018-06-13 8:55 ` Viresh Kumar
2018-06-13 9:03 ` Daniel Lezcano
2018-06-13 9:10 ` Viresh Kumar
2018-06-15 8:13 ` Daniel Lezcano
2018-06-12 12:59 ` Peter Zijlstra
2018-06-13 8:24 ` Viresh Kumar
2018-06-12 14:23 ` Peter Zijlstra
2018-06-12 14:45 ` Daniel Lezcano
2018-06-12 14:26 ` Peter Zijlstra
2018-06-12 14:46 ` Daniel Lezcano
2018-06-13 15:54 ` Pandruvada, Srinivas
2018-06-13 20:00 ` Daniel Lezcano
2018-06-13 20:07 ` Pandruvada, Srinivas
2018-06-13 20:19 ` Daniel Lezcano
2018-06-13 20:32 ` Pandruvada, Srinivas
2018-06-13 20:35 ` Daniel Lezcano
2018-06-13 21:27 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180612173514.GV12217@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=andrea.parri@amarulasolutions.com \
--cc=daniel.lezcano@linaro.org \
--cc=daniel.thompson@linaro.org \
--cc=edubezval@gmail.com \
--cc=javi.merino@kernel.org \
--cc=kevin.wangtao@linaro.org \
--cc=leo.yan@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=rui.zhang@intel.com \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox