From nobody Sat Jul 15 08:57:40 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 4R32Kw44hcz4nR8P; Sat, 15 Jul 2023 08:57:40 +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 4R32Kw3ZHGz4F5J; Sat, 15 Jul 2023 08:57:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689411460; 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=zXlHph2RR6gHGeQTGxbv7gLaGITAgrr98yZZqBUu4wQ=; b=cBD2kg1suE9zvXc+WYwnaTN09nWwIekJtc/+NWxPYbqhPwPlHIFuICWO/0ZAYpaHfy+anm T0Rvy8kOQjy7mxLkEut2zOtD0Ttt7kePNwaJzUXjG9FTb4A+DdUdPYktUHpb2VzblN/Mr4 OFQM6AdF/b3pdwiQNIEHhrfzZhL6uDL9RE2nw12nXvQaKdnkqxyxZrrFrDRtGC/XidovIy DlGbthDMLjyUKHZqe+Wq9hx8UI2Y+OuPczP7pC6VHspQzNB+d+H3Q1GH+CqTJdsseam3aw Aekybx/A0HtShp5URGTXDDmpDc3cTish44mYqjTZg3AsxqGq7bK5Nb+l+IzwaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689411460; 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=zXlHph2RR6gHGeQTGxbv7gLaGITAgrr98yZZqBUu4wQ=; b=IcLOrYU9SYvZZhtuZBjvonwqi1V6Pdp1wk7yZk83yeq47FINfQkzfzgMrq40BwDMl4EWKS 5ysaQ4dH+h3XAkLhMEnbmsiSrc52bM9bzBdkKN6gsPDccbpj++hCUDMx/yDxHcpV7skW7x APac+brFML34tsjUTZB/trDKbytj/pDuCijHBXucDQ7dgIVASGsKeG3K/o4aAslAWrDFye T0rQdD82w2OIiOA3wBA/uFTiFF+ABLSczcd34QFzkynSt5Xrxn6t6EqtQpG6d0zPjK2M5/ ir9l1zr2ase9k9GtchWiNdIF0zU0If/7JjfVxLcjJP0pK7PH5cUO0Nppvnmzpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689411460; a=rsa-sha256; cv=none; b=hR+LrqpVshXwCshf/YmnGdS8hb9/MDUEaAPZ0QGr1MRLJ7FgcDv1j1vXTOgy/N/scSfDsw T5Oz98RKS3mr2swYDzwu5rmH22cz5pwMud/ayU5l+ShGWMc8oR8hBXMYoWnfaurgPPgOnV q95U3UvbppWQoJOK2H3KpOg96xYKXdQEqL2iTBE6f3YjFJLoGxj/GS/AsLpN4/cPaS+irQ ybSiaNmkrgKbA/LUECNoxIcCFoU6j4oVQMSVfqnso5cOgNRiMdGhChydkNNcImsVa4U1HS qouRl7foxo5KCI5Hr7OvLcaf2dMZqHbSOgWLJtcKLMkIjLnsUFIojnYRcdQflw== 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 4R32Kw2d8vztDy; Sat, 15 Jul 2023 08:57:40 +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 36F8veEm033865; Sat, 15 Jul 2023 08:57:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36F8vebD033864; Sat, 15 Jul 2023 08:57:40 GMT (envelope-from git) Date: Sat, 15 Jul 2023 08:57:40 GMT Message-Id: <202307150857.36F8vebD033864@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Jan Beich Subject: git: 9bb1dbe67772 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 9bb1dbe677724f5a7a6bb29e6978842468387670 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jbeich: URL: https://cgit.FreeBSD.org/ports/commit/?id=9bb1dbe677724f5a7a6bb29e6978842468387670 commit 9bb1dbe677724f5a7a6bb29e6978842468387670 Author: Jan Beich AuthorDate: 2023-07-15 08:31:14 +0000 Commit: Jan Beich CommitDate: 2023-07-15 08:57:03 +0000 x11-wm/kwinft: support mac_priority(4) on Wayland https://blog.martin-graesslin.com/blog/2017/09/kwinwayland-goes-real-time/ --- 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 56a796c3d84a..7535d04701aa 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 } ]