linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Patrick Bellasi <patrick.bellasi@arm.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Steve Muckle <steve.muckle@linaro.org>,
	Leo Yan <leo.yan@linaro.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Todd Kjos <tkjos@google.com>,
	Srinath Sridharan <srinathsr@google.com>,
	Andres Oportus <andresoportus@google.com>,
	Juri Lelli <juri.lelli@arm.com>,
	Morten Rasmussen <morten.rasmussen@arm.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Chris Redpath <chris.redpath@arm.com>,
	Robin Randhawa <robin.randhawa@arm.com>,
	Li Zefan <lizefan@huawei.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Ingo Molnar <mingo@redhat.com>
Subject: Re: [RFC v2 5/8] sched/tune: add initial support for CGroups based boosting
Date: Thu, 27 Oct 2016 16:39:47 -0400	[thread overview]
Message-ID: <20161027203947.GA14477@htj.duckdns.org> (raw)
In-Reply-To: <20161027201439.GA3668@derkdell>

Hello, Patrick.

On Thu, Oct 27, 2016 at 09:14:39PM +0100, Patrick Bellasi wrote:
> I'm wondering also how much confusing and complex it can be to
> configure a system where you have not overlapping groups of tasks with
> different bandwidth and boosting requirements.
> 
> For example, let assume we have three tasks: A, B, and C and we want:
> 
>    Bandwidth:  10% for A and B,  20% for C
>    Boost:      10% for A,         0% for B and C
> 
> IMO, configuring such a set of constraints would be quite complex if
> we expose the boost value through the cpu controller.

Going back to your use case point, when would we realistically need
this?

> > Note that hierarchy
> > support doesn't necessarily mean that boosting itself has to be
> > hierarchical.
> 
> Initially I've actually considered such a design, however...
> 
> >It can be, for example, something along the line of
> > "the descendants are allowed upto this level of boosting" so that the
> > hierarchy just serves to assign the appropriate boosting values to the
> > groups of tasks.
> 
> ... the current "single layer hierarchy" has been proposed instead for
> two main reasons.
> 
> First, we was not able to think about realistic use-cases where we
> need this "up to this level" semantic.
> For boosting purposes, tasks are grouped based on their role and/or
> importance in the system. This property is usually defined in
> "absolute" terms instead of "relative" therms.
> Does it make sense to say that task A can be boosted only up to how
> much is task B? In our experience probably never.

There are basic semantics that people expect when they use cgroup for
resource control and it enables things like layering and delegating
configuration.

> The second reason is mainly related to the possibility to have an
> efficient and low-overhead implementation. The currently defined
> semantic for CPU boosting requires to perform certain operations at
> each task enqueue and dequeue events. Some of these operations are
> part of the hot path in the scheduler code. The flat hierarchy allows
> to use per-cpu data structures and algorithms which aims at being
> efficient in reducing the overheads incurred in doing the required
> accounting.

Unless I'm misunderstanding, the actually applied attributes should be
calculable during config changes or task migration, right?  The
hierarchy's function would be allowing layering and delegating
configurations and shouldn't get in the way of actual enforcement.

> As a final remark, I would like to say that Google is currently using
> SchedTune in Android to classify tasks by "importance" and feed this
> information into the scheduler. Doing this exercise, so far we did not
> spot limitations related to the usage of a flat hierarchy.
> 
> However, I like to have this discussion, which it's actually the main
> goal of this RFC. My suggestion is just that we should think about
> use-cases before and than introduce a more complex solution, but only
> if we convince ourself that it can bring more benefits than burdens in
> code maintainability.
> 
> Is your request for a "proper support for hierarchy" somehow related to
> the requirements for the "unified hierarchy"? Or do you see also other
> more functional/semantic aspects?

Not necessarily.  In general, all controllers, whether on v1 or v2,
should be fully hierarchical for reasons mentioned above.  I get that
flat was fine for android but flat hierarchy would be fine for most
controllers for android.  That's not the only use case we should be
considering, right?

> > Thanks.
> 
> If you are going to attend LPC next week, I hope we can have a chat on
> these topics.

Yeah, sure, I'll be around till Thursday.  Let's chat there.

Thanks.

-- 
tejun

  reply	other threads:[~2016-10-27 20:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-27 17:41 [RFC v2 0/8] SchedTune: central, scheduler-driven, power-perfomance control Patrick Bellasi
2016-10-27 17:41 ` [RFC v2 1/8] sched/tune: add detailed documentation Patrick Bellasi
2016-11-04  9:46   ` Viresh Kumar
2016-11-08 10:53     ` Patrick Bellasi
2016-10-27 17:41 ` [RFC v2 2/8] sched/tune: add sysctl interface to define a boost value Patrick Bellasi
2016-10-27 17:41 ` [RFC v2 3/8] sched/fair: add function to convert boost value into "margin" Patrick Bellasi
2016-10-27 17:41 ` [RFC v2 4/8] sched/fair: add boosted CPU usage Patrick Bellasi
2016-10-27 17:41 ` [RFC v2 5/8] sched/tune: add initial support for CGroups based boosting Patrick Bellasi
2016-10-27 18:30   ` Tejun Heo
2016-10-27 20:14     ` Patrick Bellasi
2016-10-27 20:39       ` Tejun Heo [this message]
2016-10-27 22:34         ` Patrick Bellasi
2016-10-27 17:41 ` [RFC v2 6/8] sched/tune: compute and keep track of per CPU boost value Patrick Bellasi
2016-10-27 17:41 ` [RFC v2 7/8] sched/{fair,tune}: track RUNNABLE tasks impact on " Patrick Bellasi
2016-10-27 17:41 ` [RFC v2 8/8] sched/{fair,tune}: add support for negative boosting Patrick Bellasi
2016-10-27 20:58 ` [RFC v2 0/8] SchedTune: central, scheduler-driven, power-perfomance control Peter Zijlstra
2016-10-28 10:49   ` Patrick Bellasi

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=20161027203947.GA14477@htj.duckdns.org \
    --to=tj@kernel.org \
    --cc=andresoportus@google.com \
    --cc=chris.redpath@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=hannes@cmpxchg.org \
    --cc=juri.lelli@arm.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=morten.rasmussen@arm.com \
    --cc=patrick.bellasi@arm.com \
    --cc=peterz@infradead.org \
    --cc=rjw@rjwysocki.net \
    --cc=robin.randhawa@arm.com \
    --cc=srinathsr@google.com \
    --cc=steve.muckle@linaro.org \
    --cc=tkjos@google.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;
as well as URLs for NNTP newsgroup(s).