lkml.org 
[lkml]   [2019]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC 1/3] Introduce latency-tolerance as an per-task attribute
Date
Latency-tolerance indicates the latency requirements of a task with respect
to the other tasks in the system. The value of the attribute can be within
the range of [-20, 19] both inclusive to be in-line with the values just
like task nice values.

latency_tolerance = -20 indicates the task to have the least latency as
compared to the tasks having latency_tolerance = +19.

The latency_tolerance may affect only the CFS SCHED_CLASS by getting
latency requirements from the userspace.

Signed-off-by: Parth Shah <parth@linux.ibm.com>
---
include/linux/sched.h | 3 +++
include/linux/sched/latency_tolerance.h | 13 +++++++++++++
2 files changed, 16 insertions(+)
create mode 100644 include/linux/sched/latency_tolerance.h

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 2c2e56bd8913..bcc1c1d0856d 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -25,6 +25,7 @@
#include <linux/resource.h>
#include <linux/latencytop.h>
#include <linux/sched/prio.h>
+#include <linux/sched/latency_tolerance.h>
#include <linux/sched/types.h>
#include <linux/signal_types.h>
#include <linux/mm_types_task.h>
@@ -666,6 +667,8 @@ struct task_struct {
#endif
int on_rq;

+ int latency_tolerance;
+
int prio;
int static_prio;
int normal_prio;
diff --git a/include/linux/sched/latency_tolerance.h b/include/linux/sched/latency_tolerance.h
new file mode 100644
index 000000000000..7a00abe05bc4
--- /dev/null
+++ b/include/linux/sched/latency_tolerance.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_SCHED_LATENCY_TOLERANCE_H
+#define _LINUX_SCHED_LATENCY_TOLERANCE_H
+
+#define MAX_LATENCY_TOLERANCE 19
+#define MIN_LATENCY_TOLERANCE -20
+
+#define LATENCY_TOLERANCE_WIDTH \
+ (MAX_LATENCY_TOLERANCE - MIN_LATENCY_TOLERANCE + 1)
+
+#define DEFAULT_LATENCY_TOLERANCE 0
+
+#endif /* _LINUX_SCHED_LATENCY_TOLERANCE_H */
--
2.17.2
\
 
 \ /
  Last update: 2019-11-25 10:47    [W:0.131 / U:0.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site