Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jun 2022 21:51:51 GMT
From:      Vladimir Kondratyev <wulf@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 8f41e6af5362 - stable/13 - LinuxKPI: Implement sched_set_fifo(_low) functions
Message-ID:  <202206012151.251LppRS042855@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=8f41e6af5362cd4d33be764067a5c2642716dc3d

commit 8f41e6af5362cd4d33be764067a5c2642716dc3d
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2022-05-17 12:10:20 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2022-06-01 21:50:14 +0000

    LinuxKPI: Implement sched_set_fifo(_low) functions
    
    Required by:    drm-kmod
    
    MFC after:      1 week
    Reviewed by:    hselasky, manu
    Differential Revision:  https://reviews.freebsd.org/D35050
    
    (cherry picked from commit 0093bc3cd17c2f657682258fae73737655b8a573)
---
 sys/compat/linuxkpi/common/include/linux/sched.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/sched.h b/sys/compat/linuxkpi/common/include/linux/sched.h
index 1d0666b8da0b..4d1e669dd32e 100644
--- a/sys/compat/linuxkpi/common/include/linux/sched.h
+++ b/sys/compat/linuxkpi/common/include/linux/sched.h
@@ -34,6 +34,7 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/proc.h>
+#include <sys/rtprio.h>
 #include <sys/sched.h>
 #include <sys/sleepqueue.h>
 #include <sys/time.h>
@@ -216,4 +217,24 @@ get_task_comm(char *buf, struct task_struct *task)
 	return (task->comm);
 }
 
+static inline void
+sched_set_fifo(struct task_struct *t)
+{
+	struct rtprio rtp;
+
+	rtp.prio = (RTP_PRIO_MIN + RTP_PRIO_MAX) / 2;
+	rtp.type = RTP_PRIO_FIFO;
+	rtp_to_pri(&rtp, t->task_thread);
+}
+
+static inline void
+sched_set_fifo_low(struct task_struct *t)
+{
+	struct rtprio rtp;
+
+	rtp.prio = RTP_PRIO_MAX;	/* lowest priority */
+	rtp.type = RTP_PRIO_FIFO;
+	rtp_to_pri(&rtp, t->task_thread);
+}
+
 #endif	/* _LINUXKPI_LINUX_SCHED_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202206012151.251LppRS042855>