From nobody Wed Oct 09 16:55:45 2024 X-Original-To: dev-commits-doc-all@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 4XNzXx2fLgz5YlQj for ; Wed, 09 Oct 2024 16:55:45 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XNzXx27n9z42Tw; Wed, 9 Oct 2024 16:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728492945; 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=fE6w1DLBqqUviMl02OKMFqUsGsBS62/HOTOfatFzrXY=; b=VbpNUgoDcePTuSZ/zkSSgJma5Kmi6EihYktQeAmk1bUj9RIfYQNn5NgGnRcAyLpOcnvg1A ZvqcQas8Bddh6QOA14Hv0/NiD8teD2e/duQHgH4W6SknLsZOYDy09L3ums0sDy6liSVagV TzzJ1Fx508wedY7SVEqgZuXxn2mYGivrm56s67+jKkvYU3Z0MWAp82aS4rkbIroxhSv0EX BsTAKSxJ+B384QoZkhyBUmhFj4aBYSL7BwCGHAnoSPrnbAFdeJ2wk93QLWjwm6E3w4Cz3n UZCSDR0O/q0u2adjaZ1Pj2/0DMtXY/Xb9Z/yR/f1h3gWLm+eLMzHFDg+222Lcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728492945; 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=fE6w1DLBqqUviMl02OKMFqUsGsBS62/HOTOfatFzrXY=; b=HwwWXC3e6wU66R+KKDEHAy+Nj8HCZZ+BW9hzpogmjn19+IWOE8j5urJ7siXysg7R+1pjSU Lh2ntvUFeG0Th1/VDvczEjdbRkoVMPtGikdhlDkoMzeVtUKdbkEXyETssGTnl+31sWhbXm oZEGFMB+ak9Yc6h0IU4q4HtSDI0qxuov5iO28SVvhyoyinsOdF1bcBHcfExo6EqsKp8pnq y4y3WFYmJe+0x//tfxbCJRWz4/Tqn+sv1Pdrq/YitU6e3JmX0BKKWaKqNZBOyDiltZYfBE n6uwXPvv9Hfn5qq7Ldvp8IqUhiy7gy6HU1c8uZ9l48bt77tqW9RIM5z4+wn4PQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728492945; a=rsa-sha256; cv=none; b=oHuMyStV/3wlm88wLrRIfxNh4V/oFVTzOC5I6Iv8fAfv2FUPfk2Ylkn1Y/zC2VQDY3q/V2 gHP1Z9QA3Uh0+iiTyUgNJa50djeJtomb6SoYzfITVbKyBFM38LN0gxxlD3KwepzvyaqIJ5 oIeR+eIeHtXoa9Dh+Xc429lZhFoghsBj+oyDNJM5oxkPNwpCeVBDWUYx6JrYxOd3aPlVXo 81ZFGws4abt2g4NAyGE4QZPnoIiH8varXUAnqTDx/NcmV5vL8JH+ZKzXt9Kdxb+4fCU00K RaB5pou7rY9+rhX/yK3CA/44cWM6iBnSNBW1HGaIggwhtIU+IkF8oW8+iqq3Lg== 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 4XNzXx1lR3zMNw; Wed, 9 Oct 2024 16:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 499Gtj6x097920; Wed, 9 Oct 2024 16:55:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 499GtjpA097917; Wed, 9 Oct 2024 16:55:45 GMT (envelope-from git) Date: Wed, 9 Oct 2024 16:55:45 GMT Message-Id: <202410091655.499GtjpA097917@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Olivier Certner Subject: git: 43c126c9f5 - main - status: 2024Q3: Scheduling Priorities: 256-queue Runqueues Sub-Project List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-doc-all@freebsd.org Sender: owner-dev-commits-doc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43c126c9f55567843b20e8978a50b971ec8f8277 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/doc/commit/?id=43c126c9f55567843b20e8978a50b971ec8f8277 commit 43c126c9f55567843b20e8978a50b971ec8f8277 Author: Olivier Certner AuthorDate: 2024-10-09 14:10:21 +0000 Commit: Olivier Certner CommitDate: 2024-10-09 16:53:46 +0000 status: 2024Q3: Scheduling Priorities: 256-queue Runqueues Sub-Project Reviewed by: salvadore Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D47026 --- .../sched_prio-256_queue_runqueue.adoc | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/website/content/en/status/report-2024-07-2024-09/sched_prio-256_queue_runqueue.adoc b/website/content/en/status/report-2024-07-2024-09/sched_prio-256_queue_runqueue.adoc new file mode 100644 index 0000000000..3e39a9163b --- /dev/null +++ b/website/content/en/status/report-2024-07-2024-09/sched_prio-256_queue_runqueue.adoc @@ -0,0 +1,25 @@ +=== Scheduling Priorities: 256-queue Runqueues Sub-Project + +Contact: Olivier Certner + +The goal of the 256-queue runqueues sub-project is to fix FreeBSD's POSIX compliance in that different priority levels in the `SCHED_FIFO` or `SCHED_RR` scheduling classes must lead to immediate preemption by threads having higher priority. +It is part of the bigger scheduling priorities revamp project aiming at rationalizing FreeBSD scheduling interfaces, including having consistent man:rtprio[2] and POSIX interface behaviors (where it makes sense), enhancing POSIX compliance, removing duplicate code and fixing existing bugs, and enhancing the non-standard parts both for better control and security. +Expected benefits are increased usage of FreeBSD as a soft real-time platform, e.g., for video and audio processing in casual desktop uses to professional settings. +Readers interested in this topic are invited to consult link:https://papers.freebsd.org/2024/asiabsdcon/certner-Scheduling_priorities_in_FreeBSD.files/AsiaBSDCon2024-Certner-Scheduling_priorities_in_FreeBSD-Article.pdf[AsiaBSDCon 2024's paper] and link:https://papers.freebsd.org/2024/eurobsdcon/certner-Scheduling_Priorities_and_FreeBSD.files/EuroBSDCon2024-Certner-Scheduling_Priorities_and_FreeBSD.pdf[EuroBSDCon 2024's slides] for a wider view, and to contact me for questions, feedbacks or discussions. + +Currently, priority levels specified either through the `prio` field of `struct rtprio` (man:rtprio[2] interface) or the `sched_priority` one of `struct sched_param`, for real-time scheduling classes (`RTP_PRIO_FIFO` and `RTP_PRIO_REALTIME` for the former, `SCHED_FIFO` and `SCHED_RR` for the latter) as well as idle-time ones (`RTP_PRIO_IDLE`), are conflated as follows: Each priority level that has the same quotient when divided by 4 is internally treated the same. +In particular, threads being in the same such equivalence class but having higher priority will not preempt other threads in the same class, violating POSIX expectations for `SCHED_FIFO` and `SCHED_RR`. + +To remedy this situation, we have chosen an impacting internal change on the number of queues per runqueue, and defer to the above-mentioned EuroBSDCon 2024's slides for more details. + +The switch to 256-queue runqueues having non-trivial impacts on the ULE scheduler, we have been analyzing it and tuning the scheduler to preserve its previous behavior with respect to anti-starvation and the effect of nice values. +With the goal to perform further testing, we have revived Jeff Roberson's initial ULE's test tool, called `late` (currently available on link:https://github.com/OlCe2/late[GitHub]). + +All the modifications made as part of this sub-project are currently under review, starting with Phabricator's link:https://reviews.freebsd.org/D45387[review D45387] (click on the "Stack" tab to see the full series of reviews). + +In the course of this project, we have noticed that the effect of nice values is especially weak, and consequently have produced experimental patches to make their effect stronger. +However, it is not clear at this point whether we can increase their effect satisfactorily enough in the current ULE setting. + +We have also started another scheduler project about adapting ULE to hybrid architectures, which might also trigger more drastic scheduler changes. + +Sponsor: The FreeBSD Foundation