From nobody Wed Jun 1 21:51:51 2022 X-Original-To: dev-commits-src-branches@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 5F4791B5CBCF; Wed, 1 Jun 2022 21:51:52 +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 4LD2sz6nrQz4rBd; Wed, 1 Jun 2022 21:51:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654120312; 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=m52StRVsdSfmqQJVaxsXbBrJr1fKQQ+1G8QZuPwXWbk=; b=d8s3yLt5ioSkYTrXrqDkhUHtIvO9/mn0TSjFaqZJkTHANKlPSLGW89PCynhDPLdHOp8hn3 B/h8LAmwwMfDpMwiVcRMIt2F8w1inX5RelfZGp+s/izF7yPLKdat8ad6CAXzOVaXLmbrON DLIc5I7NCD0YgNFhiP1qzjRQnY7ANf1OlnXO/9Omab9kODwpIjK4qK39HfpcIgOD0hGrSm Q9CvId15fMLF7v/rEnSypHNdrG/Too7cCB6UmgAyhQYu9nnkf+Fg04cJI9CGtXk8VsbjpR oqTCBfhTe7q3k+3hjCi3xi5jnK3a+IkQ70KicqyeuFMIczBe2z/5botGmVsY3w== 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 2437C27ED9; Wed, 1 Jun 2022 21:51:51 +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 251LppdA042856; Wed, 1 Jun 2022 21:51:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 251LppRS042855; Wed, 1 Jun 2022 21:51:51 GMT (envelope-from git) Date: Wed, 1 Jun 2022 21:51:51 GMT Message-Id: <202206012151.251LppRS042855@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 8f41e6af5362 - stable/13 - LinuxKPI: Implement sched_set_fifo(_low) functions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 8f41e6af5362cd4d33be764067a5c2642716dc3d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654120312; 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=m52StRVsdSfmqQJVaxsXbBrJr1fKQQ+1G8QZuPwXWbk=; b=B1/vwsgdrtYoTrETeq00qnIhCYqPlb5OPdEAgmlDJV0MWiaJr67e6QsjTOdDnUrm5fzhZa A4hhbDpl5AySs78x2wT5s7vxlkK5OsD6250V0KlA6BHobeFNpt5ZCuXJmbmBw6IWCPrfQj kkl3JHVvsjz0ENV9obz50pZtFcl/5HLEyna7SCi4TYD8NWWSwELFRfYioeX+Vc8pmEsBzy QXiR/VHoOtV0kPq15eg4XOGq9JE/0EdwNfkYJ0Yn/cgzVptbSxArEsLuwcPQHHdFUp5YDt MU1eqvFDrjDkVJp/bKXk7Mkify/H79yur8H/OKC7HH+TlpuiFIVWNxz6UcJ7Qg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654120312; a=rsa-sha256; cv=none; b=u/dXYRG4IWEzOYIbMtpY/isE0KKbmGkFpdzOMOs+47L246v8L8UbeXG1tGansqRk+BNiLC QykKU6tqkpxcOnnf4OVWO+vpXZ67DjGjByqVVWuj4vJV3rnq85lozO3p3UFBYgafurLItJ wmA+P0XilIelCo2PoaE798UybU88eNupcfdC4FmcljWqh3Knj0z+FOmccKpzeE/69FnW/J UECXi/qhYUapsg1uiCVDcsnMndeR/o4XM4+mT0mDD+zGZhajMuTvbjZ4vDMj5unkpkvHMj knBJuVQgrSlcqO13DfC8chqn9FvYRlfeYetnPunruX2HsJlttL0jfIOInndeAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=8f41e6af5362cd4d33be764067a5c2642716dc3d commit 8f41e6af5362cd4d33be764067a5c2642716dc3d Author: Vladimir Kondratyev AuthorDate: 2022-05-17 12:10:20 +0000 Commit: Vladimir Kondratyev 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 #include #include +#include #include #include #include @@ -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_ */