From nobody Mon Jul 29 23:57:25 2024 X-Original-To: dev-commits-ports-main@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 4WXwJj5JJsz5SFLH; Mon, 29 Jul 2024 23:57: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXwJj4X0kz4DBf; Mon, 29 Jul 2024 23:57:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722297445; 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=IxYKyRo7kAyw8v333yKyzzaSMMbPI9Ma2sLa5xTDxpY=; b=eDTloL2GU5V9OxrCerxMqd6sWTPhAPYNqFsh0BKpxytQ1g3TJ43MLZjIQe0WOD1l643GXt d7pHVChK7tWrFMmg+s2mrxgjCXa9yuyWryEbWEToCesqfZmUDKnHUZjqMRsHeVvPGIAxaZ TDSSMyZyd9/weO6IhUyBMFDPGOvIMmJu16k3WWtSebDpu87m9cUb8W4jpiam6vz4Ccjbp4 JoICkNXzxDsKtGVepPVxbVM90zhBcONzot8IrwDuG4FT0pgpNyEjAVZRi1DR3RLRhHXpkO enLHnNHujjffT4hCOvqAMLgZAjo+yETwvNlCRjTvythsSpP02riP56sXf57KmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722297445; a=rsa-sha256; cv=none; b=JN2dkK3bwDOFvfK4NVL19qB5ZbXcoE/0ssfsJrhFBBJG+9ZzgPsSftg0OPlx1sWqDoidQz X20xSN97pbPAbXIW6pys3PaAFp1AusKEK+uCWl4i5Q1h65Qydurq1fBgpLzwTKwiN7Cd71 Dw+r7uDi0sOeS/Efry8eKgvR9qFE1iK63bJVKFSir05FEGOgm9psC+S7wz3803083SwKce XIySjjx88N9Lx9A/FanHwzCs2qGZpzR7L+840TVpSxC2T55bcybC2uL71Tv+F+PhzU6Wd1 9pGmpR5c72WiOMs+qQKHCCLJuQPxxfP1L1DumVzA8O97BVSh9HaeEtlf0omX9w== 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=1722297445; 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=IxYKyRo7kAyw8v333yKyzzaSMMbPI9Ma2sLa5xTDxpY=; b=SjoC8lgCAnTYYbt9iaxYL7R0AWAGz89wCzbHqC7N1WLm12sq+RXdyGRaAG010F8+f5i6q8 DUeVtr0oRV0Me5enxK6qwUtoFhNWxv1dmgzhUBABPXAY56tPomva/O5b+u/ZFp7j6kTckU Yp834IN2dtcfQE49u4okTOts1JBCMhwQTBAHs+WwRYb+oR9LwSjjr6c91zDl7ro82ZG/VY 3DvcW6DrimZLkZZjhjJPt2M3OUe8/LDCy5BSQbGsAjTLwtttG+MzNqPxA3TqGy7lXiboO+ A2j5Rvm6XC2NE0peEqjAxedT8VeLrL6axh+xa49hlsVLN+0nFtAy0VtJrqOC/Q== 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 4WXwJj45Ktztml; Mon, 29 Jul 2024 23:57:25 +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 46TNvPgc051235; Mon, 29 Jul 2024 23:57:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TNvPmE051232; Mon, 29 Jul 2024 23:57:25 GMT (envelope-from git) Date: Mon, 29 Jul 2024 23:57:25 GMT Message-Id: <202407292357.46TNvPmE051232@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: c64a29abe541 - main - emulators/virtualbox-ose-kmod-legacy: Catch up with FreeBSD KPI changes List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@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: c64a29abe541511b0875d568832d59347830d198 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/ports/commit/?id=c64a29abe541511b0875d568832d59347830d198 commit c64a29abe541511b0875d568832d59347830d198 Author: Mark Johnston AuthorDate: 2024-07-29 17:57:13 +0000 Commit: Mark Johnston CommitDate: 2024-07-29 23:57:11 +0000 emulators/virtualbox-ose-kmod-legacy: Catch up with FreeBSD KPI changes After 1500021, kick_proc0() doesn't exist. PR: 280495 Approved by: vvd (maintainer) --- ...untime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h | 35 +++++++++++++++++----- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/emulators/virtualbox-ose-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h b/emulators/virtualbox-ose-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h index 8c4376c342e7..127966b91f56 100644 --- a/emulators/virtualbox-ose-legacy/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h +++ b/emulators/virtualbox-ose-legacy/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 2020-05-13 19:44:32 UTC +--- src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h.orig 2020-07-09 16:57:38 UTC +++ src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h @@ -82,6 +82,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 +@@ -298,10 +300,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 + } + + /**