From nobody Mon Jul 29 23:57:24 2024 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 4WXwJh44WVz5SF4t; Mon, 29 Jul 2024 23:57:24 +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 4WXwJh3V9Zz4Cvk; Mon, 29 Jul 2024 23:57:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722297444; 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=iY8+g56HAz+L2V+J8nHC6cXAoEH49fitYS3gxNwg/90=; b=q8srQs0nYS8HcvUVwGXyR9kwPs3R2VRai9o24W2cKYQ5MHmEk/snQ3X4IWK9IMX/euspq6 xhIqUSygLqRp4jxKQxZj7Bwt4yi90XHpSoRPkA2JbOM+ga49hbVe51rkjnuzF+4wXfFJIc c6ZjuSS+GIConaU45ojalO1GpHQFYXE/2+5z5PP4CRnpiRPC2GmIbjtSXCJOFcMolGGEMn 3pQjNYr4GbPF7/WANoEO7H5VJnr8gAhqt+5oVTsFWqdyk3fshjcTqc8nGRZOU9IkFu1TaV o/9nprV6W276QFvMfPrEZIpufJyrwzRrnIFJo0VBqIlT4vn5n0XkljryS5pVtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722297444; a=rsa-sha256; cv=none; b=D6ctX2hO7cvc3gY4TPFKNoCcBtdiTiD9qQVDi0LINByn09y59w6eR7fXhDacjoQR/FOaLW 2f9P6LP87pkKl3I8ftIdWODCrtnsk/00vqbNTXFMGse4YgzA00f4CHVpg1JJADGFefe1Sg lfOH7GYXZqK1GGgkbFJZCYFWQ9oMM5T8eTzj8jmmOs3dafW/U/2HyBCC8y6RRG474ACpLS Ns8SfWchcaUyvvT+FkV8ty1RBw0NcwsBKXFMp8+oRORl8wpTk/NecRWd4xKRirabYnR2Uj qbqNgxgJpnVruZL1jB2pYw79xYUlx6pguZoOxuQJ1rmTh4Sgy5ip/E8rkl0QSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722297444; 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=iY8+g56HAz+L2V+J8nHC6cXAoEH49fitYS3gxNwg/90=; b=Zs/aicyrVNVu5DDHcAMj20vOXGsuwfqzoSW/DzUEM1Dnqgb5YUKpBxawCfs5fWgcLuE0XM ZBTkrCgXwBxyraHLOgm+Sp7u9sADFZqDgYtH5KyLCdtTDU4+l1T9tQKrkatSpEl6qdOyBo TvjUMPGlUcUNuUorIDaoBLB5IJQerKA/ZOurK29BKIszuOkEn88s7gRz30GmKH9S1QO5vq LRFSNgIg26Gt6AL1ieyQVwS2jUPhfodqlItYO1p0CiLQ2LrUCxqnNUc+Kj2MuAEMEF33gZ JI2DBqi+aFwtpGsB+pK5M6h42/USdPlg6GCsP80++uXr1iXIEd+ouiDqAoWaLQ== 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 4WXwJh35F9zvFF; Mon, 29 Jul 2024 23:57:24 +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 46TNvOWn051187; Mon, 29 Jul 2024 23:57:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TNvOmZ051184; Mon, 29 Jul 2024 23:57:24 GMT (envelope-from git) Date: Mon, 29 Jul 2024 23:57:24 GMT Message-Id: <202407292357.46TNvOmZ051184@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mark Johnston Subject: git: 53bede4bcb3a - main - emulators/virtualbox-ose-kmod: Catch up with FreeBSD KPI changes 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: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 53bede4bcb3acee01ef26086c9cb5561fb7a20f1 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/ports/commit/?id=53bede4bcb3acee01ef26086c9cb5561fb7a20f1 commit 53bede4bcb3acee01ef26086c9cb5561fb7a20f1 Author: Mark Johnston AuthorDate: 2024-07-29 13:18:10 +0000 Commit: Mark Johnston CommitDate: 2024-07-29 23:57:11 +0000 emulators/virtualbox-ose-kmod: Catch up with FreeBSD KPI changes After 1500021, kick_proc0() doesn't exist. PR: 280495 Approved by: vvd (maintainer) Reported by: Michael Butler --- ...untime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h | 35 +++++++++++++++++----- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h b/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h index e647f328a36d..c18492ebdf9b 100644 --- a/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h +++ b/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h @@ -1,13 +1,15 @@ -Without this patch any waits for periods shorter than a single tick return -immediately leading to a lot of unnecessary spinning. For example, I observe that -my guest's idle loop does a lot of sleeps with periods slightly shorter than 1 ms -(1/hz), e.g. 900us. All that waiting turns into pure spinning and VirtualBox eats -100% of a core. -The patch improves the situation significantly. Also, it (approximately) follows -what tvtohz does. +Without the first part of this patch, any waits for periods shorter than a +single tick return immediately leading to a lot of unnecessary spinning. For +example, I observe that my guest's idle loop does a lot of sleeps with periods +slightly shorter than 1 ms (1/hz), e.g. 900us. All that waiting turns into pure +spinning and VirtualBox eats 100% of a core. + +The clamping improves the situation significantly. Also, it (approximately) +follows what tvtohz does. The rest of the patch just chases an upstream +KPI change. Submitted by: Andriy Gapon ---- src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h.orig 2021-01-07 15:42:09 UTC +--- src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h.orig 2024-07-29 13:10:32 UTC +++ src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h @@ -84,6 +84,8 @@ DECLINLINE(uint32_t) rtR0SemBsdWaitUpdateTimeout(PRTR0 uint64_t cTicks = ASMMultU64ByU32DivByU32(uTimeout, hz, UINT32_C(1000000000)); @@ -18,3 +20,20 @@ Submitted by: Andriy Gapon else pWait->iTimeout = (int)cTicks; #endif +@@ -300,10 +302,16 @@ DECLINLINE(void) rtR0SemBsdSignal(void *pvWaitChan) + DECLINLINE(void) rtR0SemBsdSignal(void *pvWaitChan) + { + sleepq_lock(pvWaitChan); ++#if __FreeBSD_version < 1500022 + int fWakeupSwapProc = sleepq_signal(pvWaitChan, SLEEPQ_CONDVAR, 0, 0); ++#else ++ sleepq_signal(pvWaitChan, SLEEPQ_CONDVAR, 0, 0); ++#endif + sleepq_release(pvWaitChan); ++#if __FreeBSD_version < 1500022 + if (fWakeupSwapProc) + kick_proc0(); ++#endif + } + + /**