linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Patrick Bellasi <patrick.bellasi@matbug.net>,
	LKML <linux-kernel@vger.kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Juri Lelli <juri.lelli@redhat.com>, Paul Turner <pjt@google.com>,
	Ben Segall <bsegall@google.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jonathan Corbet <corbet@lwn.net>,
	Dhaval Giani <dhaval.giani@oracle.com>,
	Josef Bacik <jbacik@fb.com>, Chris Hyser <chris.hyser@oracle.com>,
	Parth Shah <parth@linux.ibm.com>,
	Quentin Perret <qperret@google.com>
Subject: [SchedulerWakeupLatency] Skip energy aware task placement
Date: Thu, 23 Jul 2020 11:31:39 +0200	[thread overview]
Message-ID: <2aa4b838-c298-ec7d-08f3-caa50cc87dc2@arm.com> (raw)
In-Reply-To: <87imfi2qbk.derkling@matbug.net>

On 23/06/2020 09:29, Patrick Bellasi wrote:

> .:: Scheduler Wakeup Path Requirements Collection Template
> ==========================================================
> 
> A) Name: unique one-liner name for the proposed use-case

[SchedulerWakeupLatency] Skip energy aware task placement

> B) Target behaviour: one paragraph to describe the wakeup path issue

The search for the most energy-efficient CPU over the Performance
Domains (PDs) by consulting the Energy Model (EM), i.e. the estimation
on how much energy a PD consumes if the task migrates to one of its
CPUs, adds a certain amount of latency to task placement.

For some tasks this extra latency could be too high. A good example here
are the Android display pipeline tasks, UIThread and RenderThread. They
have to be placed on idle CPUs with a faster wakeup mechanism than the
energy aware wakeup path (A) to guarantee the smallest amount of dropped
or delayed frames (a.k.a. jank).

In Linux kernel mainline there is currently no mechanism for latency
sensitive tasks to allow that the energy aware wakeup path (A) is
skipped and the fast path (B) taken instead.

> C) Existing control paths: reference to code paths to justify B)

select_task_rq_fair()
{
        ...

	if (wakeup)
		if (asym_cpucapacity && EM && schedutil)
			new_cpu = find_energy_efficient_cpu();    <- (A)
			if (new_cpu >= 0)
				return new_cpu;
	
        ...

	if (unlikely(sd))
		/* slow path */
	else if (sd_flag & wakeup)
                /* fast path */
		new_cpu = select_idle_sibling() {
			if (asym_cpucapacity)
				new_cpu = select_idle_capacity(); <- (B)
				if (new_cpu >= 0)
					return new_cpu;
		}

        ...

        return new_cpu;
}

> D) Desired behaviour: one paragraph to describe the desired update

A mechanism for a task to skip the energy aware wakeup (A) and fallback
into the fast path (B).

> E) Existing knobs (if any): reference to whatever existing tunable

There are no existing ways to control this behaviour in Linux kernel
mainline.

There is the concept of 'prefer idle' in Android which is tightly
coupled with the proprietary cgroup controller schedtune.

> F) Existing knobs (if any): one paragraph description of the limitations

Schedtune will be replaced by mainline uclamp in upcoming Android
releases. There is no per-task 'prefer idle' interface.

> G) Proportionality Analysis: check the nature of the target behavior

The use case requires that a task either cares about latency or not.

> H) Range Analysis: identify meaningful ranges

The knob can be defined as latency sensitive (i.e. prefer an idle CPU)
or as not latency sensitive.

Mapping Analysis:

If required by other use-cases, the binary range requirement can easily
be covered by a wider, more fine grained latency sensitive range.

> I) System-Wide tuning: which knobs are required

No system-wide tuning required.

> J) Per-Task tuning: which knobs are required

The proposal is a per-task flag, indicating whether the task is latency
sensitive or not.

> K) Task-Group tuning: which knobs are required

Currently Android uses the 'prefer idle' mechanism only on task-groups
and not on individual tasks.

Therefore a per task-group implementation would be required. The
implementation should respect the cgroup resource distribution models
[1], [2].

> .:: References
> ==============

[1] LWN: The many faces of "latency nice"
    https://lwn.net/Articles/820659

[2] Control Group v2: Resource Distribution Models
    https://www.kernel.org/doc/Documentation/admin-guide/cgroup-v2.rst

  parent reply	other threads:[~2020-07-23  9:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87v9kv2545.derkling@matbug.com>
     [not found] ` <87h7wd15v2.derkling@matbug.net>
     [not found]   ` <87imgrlrqi.derkling@matbug.net>
     [not found]     ` <87mu5sqwkt.derkling@matbug.net>
     [not found]       ` <87eer42clt.derkling@matbug.net>
2020-06-23  7:29         ` Scheduler wakeup path tuning surface: Use-Cases and Requirements Patrick Bellasi
2020-06-23  7:49           ` [SchedulerWakeupLatency] Per-task vruntime wakeup bonus Patrick Bellasi
2020-07-10 13:21             ` Vincent Guittot
2020-07-10 19:59               ` Patrick Bellasi
2020-07-13 12:59                 ` Vincent Guittot
2020-07-16 16:48                   ` Dietmar Eggemann
2020-07-17 12:20                     ` Vincent Guittot
2020-07-16 19:54                   ` Patrick Bellasi
2020-07-17 14:19                     ` Vincent Guittot
2020-07-09 12:07           ` [SchedulerTaskPacking] Small background task packing Parth Shah
2020-07-09 23:08             ` [SchedulerWakeupLatency] Skipping Idle Cores and CPU Search chris hyser
2020-07-20  8:47               ` Dietmar Eggemann
2020-07-22 18:56                 ` chris hyser
2020-07-20 15:20             ` [SchedulerTaskPacking] Small background task packing Vincent Guittot
2020-07-23  9:33               ` Parth Shah
2020-07-23  9:31           ` Dietmar Eggemann [this message]
2020-07-29 14:01             ` [SchedulerWakeupLatency] Skip energy aware task placement Quentin Perret
2020-11-12  6:13           ` Scheduler wakeup path tuning surface: Interface discussion Parth Shah

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=2aa4b838-c298-ec7d-08f3-caa50cc87dc2@arm.com \
    --to=dietmar.eggemann@arm.com \
    --cc=bsegall@google.com \
    --cc=chris.hyser@oracle.com \
    --cc=corbet@lwn.net \
    --cc=dhaval.giani@oracle.com \
    --cc=jbacik@fb.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=parth@linux.ibm.com \
    --cc=patrick.bellasi@matbug.net \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=qperret@google.com \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@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).