[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-backports
Subject: [PATCH 05/30] backports: add sched_set_fifo_low
From: Hauke Mehrtens <hauke () hauke-m ! de>
Date: 2020-12-01 22:03:50
Message-ID: 20201201220415.30582-6-hauke () hauke-m ! de
[Download RAW message or body]
From: Felix Fietkau <nbd@nbd.name>
It is needed for mt76.
This was added in upsteram Linux commit 7318d4cc14c8 ("sched: Provide sched_set_fifo()")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
[Use WARN_ON_ONCE(sched_setscheduler_nocheck(p, SCHED_FIFO, &sparam) !=
0); instead]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
backport/backport-include/linux/sched.h | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 backport/backport-include/linux/sched.h
diff --git a/backport/backport-include/linux/sched.h b/backport/backport-include/linux/sched.h
new file mode 100644
index 00000000..36263857
--- /dev/null
+++ b/backport/backport-include/linux/sched.h
@@ -0,0 +1,20 @@
+#ifndef __BACKPORT_LINUX_SCHED_H
+#define __BACKPORT_LINUX_SCHED_H
+
+#include_next <linux/sched.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(5,9,0)
+#if LINUX_VERSION_IS_GEQ(4,11,0)
+#include <uapi/linux/sched/types.h>
+#endif
+
+static inline void sched_set_fifo_low(struct task_struct *p)
+{
+ struct sched_param sparam = {.sched_priority = 1};
+
+ WARN_ON_ONCE(sched_setscheduler_nocheck(p, SCHED_FIFO, &sparam) != 0);
+}
+
+#endif /* < 5.9.0 */
+#endif /* __BACKPORT_LINUX_SCHED_H */
--
2.20.1
--
To unsubscribe from this list: send the line "unsubscribe backports" in
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic