From nobody Sun Jul 23 19:27:24 2023 X-Original-To: dev-commits-ports-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 4R8Cws00z1z4nwwR; Sun, 23 Jul 2023 19:27:25 +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 4R8Cwr6fm3z4C9F; Sun, 23 Jul 2023 19:27:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690140444; 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=omjD8xA/W/5I5/RJwALY/dZrcO/b0ESX9sSMwUq5VAc=; b=YNFDP6tUDdiVddAzDXd9p2AbjKjnhTvqIRH6krhaer1sgKL16n+KugfHw4p20EGOGOLVqH TVnkAP+YRDpdmejd2T6yOCsYr62XE++58b9wgS+1RoevXbFuCSBHZvDpMlG/YoiKyKolFi 68uZitF9EOkKRcqAFEJ3uWLF7m59GpwtjM60+/EOAvigMFPPQhL0Jqmw5MNF7SjSHYvjej /T7R3hOCI7WLkEVW6kDcNZXA5160CfQ6He1vZ10vcvFjoLxGpXDAg2z5bPaUAO01xWhnAC /bHv90nH+ask/3SO7zXRcVBxpHFksGjAmXParwNxC+7OlfMFkQWTy0vomVGH5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690140444; 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=omjD8xA/W/5I5/RJwALY/dZrcO/b0ESX9sSMwUq5VAc=; b=WvCLpdroNWu0BRuLrf+uOFBg0/DNh22stzMDnaFVgGvQEKOsj5C/NsB/HpSXHHpXabbY/b 83GEmDdmFu9BW84JHu9KOvu7OVfb+xZdWcsqGlN3kY+NUHnNMCC0BE6ImhaQjTvRsWTnu/ lBz7M4j2hTrv1TP2DYbuiVEJ6pyvxRfoEcY3ctyjygVxBb9jMBVydZoYFaM/jwXJ3FoSeU lEtr0wtiWQbz4ST4i5lyMypY4nzrCB6jT3CvHhTe6jmcHjJrlPk64QSGVFcbPotHPhnsGa dbstXb5T91qaMu4F/VwAzu/0Biu8Bvl1CklBy5wUjy0eh8JWB+oW3OAoaKbpTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690140444; a=rsa-sha256; cv=none; b=oHqR/dEEwnX7cFaHXI75vAxgBmXnNRrct7DKp7bzwaeTl5j+8blaNtZ51nYj21Y3b/vNTj By6crCsTs3Co7v+Pv/jMLZVT1bPb+HPtqh75Px+GIaiyqht8NSf9tpQiPIv8tw91fbE9Oo /uMvT/T9I7p16fI689WFO0x+8/dQdu2Krh0V0yJnBU13z5k+cu4v8ndtGiIqfhQLOAWme8 Zu4cmjOb5r2S9nTt2BJRgS8bQu+SEuUEkMBrVeMcPOTsMvxRyM1sfEafaXQccuj774kK5P 8HTcWV1XRFHQ+J+ezrKv85u4y0FYcBL9YIjSq7UXsOdiNSdfyOR5h/m/cY/XZA== 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 4R8Cwr5MmlznnC; Sun, 23 Jul 2023 19:27:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36NJROUi058987; Sun, 23 Jul 2023 19:27:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36NJROeQ058986; Sun, 23 Jul 2023 19:27:24 GMT (envelope-from git) Date: Sun, 23 Jul 2023 19:27:24 GMT Message-Id: <202307231927.36NJROeQ058986@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Jan Beich Subject: git: 2ff9ebccfa41 - 2023Q3 - x11-wm/kwinft: support mac_priority(4) on Wayland List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jbeich X-Git-Repository: ports X-Git-Refname: refs/heads/2023Q3 X-Git-Reftype: branch X-Git-Commit: 2ff9ebccfa41712c5d4498a08a510e22d977fe24 Auto-Submitted: auto-generated The branch 2023Q3 has been updated by jbeich: URL: https://cgit.FreeBSD.org/ports/commit/?id=2ff9ebccfa41712c5d4498a08a510e22d977fe24 commit 2ff9ebccfa41712c5d4498a08a510e22d977fe24 Author: Jan Beich AuthorDate: 2023-07-15 08:31:14 +0000 Commit: Jan Beich CommitDate: 2023-07-23 19:26:10 +0000 x11-wm/kwinft: support mac_priority(4) on Wayland https://blog.martin-graesslin.com/blog/2017/09/kwinwayland-goes-real-time/ (cherry picked from commit 9bb1dbe677724f5a7a6bb29e6978842468387670) --- x11-wm/kwinft/Makefile | 2 +- x11-wm/kwinft/files/patch-main__wayland.cpp | 36 +++++++++++++++++++++++++++++ x11-wm/kwinft/pkg-message | 7 ++++++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/x11-wm/kwinft/Makefile b/x11-wm/kwinft/Makefile index 4c84f53db734..7ff6452443dd 100644 --- a/x11-wm/kwinft/Makefile +++ b/x11-wm/kwinft/Makefile @@ -1,7 +1,7 @@ PORTNAME= kwinft DISTVERSIONPREFIX= ${PORTNAME}@ DISTVERSION= 5.27.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= x11-wm wayland MAINTAINER= jbeich@FreeBSD.org diff --git a/x11-wm/kwinft/files/patch-main__wayland.cpp b/x11-wm/kwinft/files/patch-main__wayland.cpp new file mode 100644 index 000000000000..df6a92432f05 --- /dev/null +++ b/x11-wm/kwinft/files/patch-main__wayland.cpp @@ -0,0 +1,36 @@ +- Emulate SCHED_RESET_ON_FORK via pthread_atfork +- Switch to pthread_setschedparam as Linux sched_setscheduler + operates on threads contrary to POSIX + +--- main_wayland.cpp.orig 2023-02-17 14:50:58 UTC ++++ main_wayland.cpp +@@ -58,7 +58,7 @@ along with this program. If not, see + #include + +-#include ++#include + #include + + #include +@@ -122,12 +122,17 @@ void gainRealTime() + namespace { + void gainRealTime() + { +-#if HAVE_SCHED_RESET_ON_FORK + const int minPriority = sched_get_priority_min(SCHED_RR); + sched_param sp; + sp.sched_priority = minPriority; +- sched_setscheduler(0, SCHED_RR | SCHED_RESET_ON_FORK, &sp); +-#endif ++ if (pthread_setschedparam(pthread_self(), SCHED_RR, &sp)) ++ return; ++ ++ pthread_atfork(NULL, NULL, []() { ++ sched_param sp; ++ sp.sched_priority = 0; ++ pthread_setschedparam(pthread_self(), SCHED_OTHER, &sp); ++ }); + } + } + diff --git a/x11-wm/kwinft/pkg-message b/x11-wm/kwinft/pkg-message index 68e3a0e9b0dd..969f9444a619 100644 --- a/x11-wm/kwinft/pkg-message +++ b/x11-wm/kwinft/pkg-message @@ -36,6 +36,13 @@ Replace KWin in Plasma Desktop: $ pkg set -o x11-wm/plasma5-kwin:x11-wm/kwinft $ pkg upgrade -f kwinft $ pkg lock kwinft + +Improve Wayland responsiveness under high load: + + $ sysrc kld_list+=mac_priority + $ service kld restart + $ pw groupmod realtime -m + $ exit # log out to refresh group permissions EOM } ]