[PATCH 1/2] backports: add sched_set_fifo_low

Felix Fietkau <[email protected]>
Newsgroups org.kernel.vger.backports
Message-ID <[email protected]>
It is needed for mt76

Signed-off-by: Felix Fietkau <[email protected]>
---
 backport/backport-include/linux/sched.h | 19 +++++++++++++++++++
 1 file changed, 19 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 000000000000..be77a8d771ab
--- /dev/null
+++ b/backport/backport-include/linux/sched.h
@@ -0,0 +1,19 @@
+#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)
+#include <uapi/linux/sched/types.h>
+
+static inline void sched_set_fifo_low(struct task_struct *p)
+{
+	struct sched_param sparam = {.sched_priority = 1};
+
+	sched_setscheduler(p, SCHED_FIFO, &sparam);
+}
+
+#endif
+
+#endif
-- 
2.28.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.