lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 25 Nov 2019 15:16:16 +0530
From:   Parth Shah <parth@...ux.ibm.com>
To:     linux-kernel@...r.kernel.org
Cc:     peterz@...radead.org, mingo@...hat.com, vincent.guittot@...aro.org,
        patrick.bellasi@...bug.net, valentin.schneider@....com,
        qais.yousef@....com, pavel@....cz, dhaval.giani@...cle.com,
        qperret@...rret.net, David.Laight@...LAB.COM,
        morten.rasmussen@....com, pjt@...gle.com, tj@...nel.org,
        dietmar.eggemann@....com, viresh.kumar@...aro.org,
        rafael.j.wysocki@...el.com, daniel.lezcano@...aro.org
Subject: [RFC 1/3] Introduce latency-tolerance as an per-task attribute

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@...ux.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ