linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/3] Introduce per-task latency_tolerance for scheduler hints
@ 2019-11-25  9:46 Parth Shah
  2019-11-25  9:46 ` [RFC 1/3] Introduce latency-tolerance as an per-task attribute Parth Shah
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Parth Shah @ 2019-11-25  9:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: peterz, mingo, vincent.guittot, patrick.bellasi,
	valentin.schneider, qais.yousef, pavel, dhaval.giani, qperret,
	David.Laight, morten.rasmussen, pjt, tj, dietmar.eggemann,
	viresh.kumar, rafael.j.wysocki, daniel.lezcano

This patch series is based on the discussion started as the "Usecases for
the per-task latency-nice attribute"[1]

This patch series introduces a new per-task attribute latency_tolerance to
provide the scheduler hints about the latency requirements of the task.

Latency_tolerance is a ranged attribute of a task with the value ranging
from [-20, 19] both inclusive which makes it align with the task nice
value.

The value should provide scheduler hints about the relative latency
requirements of tasks, meaning the task with "latency_tolerance = -20"
should have lower latency than compared to those tasks with higher values.
Similarly a task with "latency_tolerance = 19" can have higher latency and
hence such tasks may bot care much about the latency numbers.

The default value is set to 0. The usecases defined in [1] can use this
range of [-20, 19] for latency_tolerance for the specific purpose. This
patch does not define any use cases for such attribute so that any change
in naming or range does not affect much to the other (future) patches using
this. The actual use of latency_tolerance during task wakeup and
load-balancing is yet to be coded for each of those usecases.

As per my view, this defined attribute can be used in following ways for a
some of the usecases:
1 Reduce search scan time for select_idle_cpu():
- Reduce search scans for finding idle CPU for a waking task with lower
  latency_tolerance values.

2 TurboSched:
- Classify the tasks with higher latency_tolerance values as a small
  background task given that its historic utilization is very low, for
  which the scheduler can search for more number of cores to do task
  packing.  A task with a latency_tolerance >= some threshold (e.g, >= +18)
  and util <= 12.5% can be background tasks.

3 Optimize AVX512 based workload:
- Bias scheduler to not put a task having latency_tolerance==-20 on a core
  occupying AVX512 based workload.

Series Organization:
======================
- Patch [1]: Add new attribute latency_tolerance to task_struct
- Patch [2]: Clone parent task's attribute on fork
- Patch [3]: Add support to sched_{set,get}attr syscall to modify
  	     latency_tolerance of the task

The patch series can be applied on tip/sched/core at
commit 57abff067a08 ("sched/fair: Rework find_idlest_group()")


References:
===========
[1]. Usecases for the per-task latency-nice attribute,
     https://lkml.org/lkml/2019/9/30/215
[2]. Task Latency-nice, "Subhra Mazumdar",
     https://lkml.org/lkml/2019/8/30/829



Parth Shah (3):
  Introduce latency-tolerance as an per-task attribute
  Propagate parent task's latency requirements to the child task
  Allow sched_{get,set}attr to change latency_tolerance of the task

 include/linux/sched.h                   |  3 +++
 include/linux/sched/latency_tolerance.h | 13 +++++++++++++
 include/uapi/linux/sched.h              |  4 +++-
 include/uapi/linux/sched/types.h        |  2 ++
 kernel/sched/core.c                     | 19 +++++++++++++++++++
 kernel/sched/sched.h                    |  1 +
 6 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 include/linux/sched/latency_tolerance.h

-- 
2.17.2


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2019-12-08  5:58 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-25  9:46 [RFC 0/3] Introduce per-task latency_tolerance for scheduler hints Parth Shah
2019-11-25  9:46 ` [RFC 1/3] Introduce latency-tolerance as an per-task attribute Parth Shah
2019-12-03  8:36   ` Qais Yousef
2019-12-03 15:47     ` Parth Shah
2019-12-05  9:24       ` Dietmar Eggemann
2019-12-05 11:42         ` Parth Shah
2019-11-25  9:46 ` [RFC 2/3] Propagate parent task's latency requirements to the child task Parth Shah
2019-11-25  9:46 ` [RFC 3/3] Allow sched_{get,set}attr to change latency_tolerance of the task Parth Shah
2019-12-03  8:39   ` Qais Yousef
2019-12-03 15:51     ` Parth Shah
2019-12-05  9:24       ` Dietmar Eggemann
2019-12-06 16:04         ` Dietmar Eggemann
2019-12-08  5:52           ` Parth Shah
2019-12-05  9:24 ` [RFC 0/3] Introduce per-task latency_tolerance for scheduler hints Dietmar Eggemann
2019-12-05 10:49   ` Valentin Schneider
2019-12-05 14:03     ` Dietmar Eggemann
2019-12-05 17:13       ` Parth Shah
2019-12-06 12:31         ` Dietmar Eggemann
2019-12-08  5:57           ` Parth Shah

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).