From nobody Tue May 17 12:11:36 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 05BCB1AEE37C; Tue, 17 May 2022 12:11:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L2ZjP0fqxz3Pht; Tue, 17 May 2022 12:11:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652789497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LrX6qK8y4/ML53caeS+1jOYmuGLrbUx3OIrqT5qRyGg=; b=woKQimjnkeHH5T8klmEbVRllAU004v64xmoKDndeWBbGCApGve6648Y2lWdGTVLOqsrblX rZ9PdSanxZeCGaq061ZPgolHro0NLRt7pAoeqo5TqhPKUvyqj1brjWGbyaghhdxuShxEyi 6CFp9smpKu6QVBM1L042Cxz8QfaJkcwBbQpQsNBuvaigwtq4/4eUT7oGWl3P4Keud98CQq 6jeYEta1Wu3voxEAEUyKG9Es6niRk+FFa29yvxXZM4dggl3XJ2ry2piCfvI08a2ZLQuE1Y /a1z4UvIEnuPhqLwJYjq5Bp6oncC1Ja0Gqq090Ep+t1dAmkLzJkmqWB5JRrOeg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1BCE147E1; Tue, 17 May 2022 12:11:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24HCBaLS093175; Tue, 17 May 2022 12:11:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24HCBaDK093174; Tue, 17 May 2022 12:11:36 GMT (envelope-from git) Date: Tue, 17 May 2022 12:11:36 GMT Message-Id: <202205171211.24HCBaDK093174@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 0093bc3cd17c - main - LinuxKPI: Implement sched_set_fifo(_low) functions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0093bc3cd17c2f657682258fae73737655b8a573 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652789497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LrX6qK8y4/ML53caeS+1jOYmuGLrbUx3OIrqT5qRyGg=; b=Ip/Z28wHAvJ2eSWbtRwppKYmfgk3FhztxBGilr6OToQF9qXY+pUb2QDSS6L0X7DunVEHsJ kGnVaKTNYBWNcc4QXjFsS+toseU1L+cpluhNFsl6iZd94+fdjbrdP3ICEgpG0b0mkLZ9cb fmWs6HANtJVMvGfQDqXr3PyKLxftjahzvDdI3UKDzDHuHsb53JYvhPJq9BKHCs4md5Lv6x +sIJqJ+9eLJPTx45IYDY1JRKsPFq86z+xs9a74isCpCSfvdXBIfLDIUBuXZyBhKEnHF0jE Pg9zZ0yyr2v9JF1jeC5Ecg7T16Uc8fvTd815CQg111ktRYwaW9FVS/gsQSfAug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652789497; a=rsa-sha256; cv=none; b=YAkoDHg00JrVSSxeE5ah0AGb1Bl4lFPBNje+QzBVCt39V+cz7N+U65m0ruRP6gyhNRB1in a9RKmJySByFWd3x8keeigROqtrHyxPnuwi8eKC416coYT8LOnhsYm8/bNt/3vrJUuckCgf lODbiS4qb1+Vj0btRRQsvQ/+kbV5MSKkkvoihH/4pZ8RmCeF8RvdzYEQCWI9ogzNWvdwKg RhKxH20uywy4AEGqkXUhNBrYXzu4UipyCRQu0+OSDwYWwtZEGDZCmxL653gxQxF9o2tZvB lorX06ITjIllZOVe4CS5lry6r8bc76H7y6XJBV9yDlCw5C3WT3Ng+MQtgZFvaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=0093bc3cd17c2f657682258fae73737655b8a573 commit 0093bc3cd17c2f657682258fae73737655b8a573 Author: Vladimir Kondratyev AuthorDate: 2022-05-17 12:10:20 +0000 Commit: Vladimir Kondratyev CommitDate: 2022-05-17 12:10:20 +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 --- 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 e57aec4d962e..cb0ffde04b2b 100644 --- a/sys/compat/linuxkpi/common/include/linux/sched.h +++ b/sys/compat/linuxkpi/common/include/linux/sched.h @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -217,4 +218,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_ */