[PATCH 05/30] backports: add sched_set_fifo_low

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Felix Fietkau <nbd@xxxxxxxx>

It is needed for mt76.

This was added in upsteram Linux commit 7318d4cc14c8 ("sched: Provide sched_set_fifo()")

Signed-off-by: Felix Fietkau <nbd@xxxxxxxx>
[Use WARN_ON_ONCE(sched_setscheduler_nocheck(p, SCHED_FIFO, &sparam) !=
0); instead]
Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
---
 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



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux