072-backports-add-sched_set_fifo_low.patch 718 B

1234567891011121314151617181920212223242526272829303132
  1. From: Felix Fietkau <[email protected]>
  2. Date: Mon, 28 Sep 2020 08:35:28 +0200
  3. Subject: [PATCH] backports: add sched_set_fifo_low
  4. It is needed for mt76
  5. Signed-off-by: Felix Fietkau <[email protected]>
  6. ---
  7. create mode 100644 backport/backport-include/linux/sched.h
  8. --- /dev/null
  9. +++ b/backport-include/linux/sched.h
  10. @@ -0,0 +1,19 @@
  11. +#ifndef __BACKPORT_LINUX_SCHED_H
  12. +#define __BACKPORT_LINUX_SCHED_H
  13. +
  14. +#include_next <linux/sched.h>
  15. +#include <linux/version.h>
  16. +
  17. +#if LINUX_VERSION_IS_LESS(5,9,0)
  18. +#include <uapi/linux/sched/types.h>
  19. +
  20. +static inline void sched_set_fifo_low(struct task_struct *p)
  21. +{
  22. + struct sched_param sparam = {.sched_priority = 1};
  23. +
  24. + sched_setscheduler(p, SCHED_FIFO, &sparam);
  25. +}
  26. +
  27. +#endif
  28. +
  29. +#endif