From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4A46217905; Wed, 30 Oct 2024 17:17:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730308645; cv=none; b=krb5NrpMkTOSbM85R0pTdfG6N4F3L0HQpT1UK1cngqlXO+Z89OowWCPcwHlbAObxudG7+2xH9qHh9opEnF5dsKebdlzQe+2Uz+OU7P2ZZE/U+6PxeRn2B46VpMOo+wx29EwKacBZRVyw1JWF0kfVp2slMP+YlK8niyfHcXu8Zk4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730308645; c=relaxed/simple; bh=R0lo9oWGVBLN0YXsMNqJOsG7ZWORWoqF08fNhhQfIGs=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=hzbkfc+ByLgP4woiW69zD6G68Mg8B2GdZ9/nl3BIIO6h4jYdjgwnXZ3s0YoULeJczyfb1ng7XNoHwrCZgY8uAnPhNkSkBs/voZ7WRHTnXihOzG9OnXM6TAAu6/nrmUXao9RLuxG1q3+rbkUXNvx4Szt1vP8WgZ0aumDT6q0+bgQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GjEHV8hE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GjEHV8hE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79C97C4CECE; Wed, 30 Oct 2024 17:17:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730308645; bh=R0lo9oWGVBLN0YXsMNqJOsG7ZWORWoqF08fNhhQfIGs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GjEHV8hEc8KHnMa/pGa3h/xakH8Pv+dc1H9VSd+iTVBm61SjjJrHcCN/DyDuci4J7 fCrK75OPZCwDRmaicsOSD43NmHE/wS20kdldoQ3w8Mj/n2OSt/4x2gMFjgjgreIdaC vl09obqk9MRFLS10KAf2a3vTCWzCuaWT4fYCm50iKlVx0ZY6gNW8ZC3nIoN2GYJz+m yVkjjUk9zXt5aZpD+/dvF7ZeQeQUrQRLUVJBHbSgyM5w306u/hrc+u+tjyWJ9zk4sR BF85UqcAc6Eb/siuw3Cr3pz+bVoSigpGVTxCdSIklnXn/bDBkESJ8PQMSqI3CUr3UE C2Qq7aYb1Iqcw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t6CJv-008LDX-Dr; Wed, 30 Oct 2024 17:17:23 +0000 Date: Wed, 30 Oct 2024 17:17:23 +0000 Message-ID: <86wmhp1pek.wl-maz@kernel.org> From: Marc Zyngier To: Raghavendra Rao Ananta Cc: Oliver Upton , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, stable@vger.kernel.org, syzbot Subject: Re: [PATCH v2] KVM: arm64: Get rid of userspace_irqchip_in_use In-Reply-To: References: <20241028234533.942542-1-rananta@google.com> <868qu63mdo.wl-maz@kernel.org> <865xpa3fwe.wl-maz@kernel.org> <87iktat2y8.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: rananta@google.com, oliver.upton@linux.dev, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, stable@vger.kernel.org, syzkaller@googlegroups.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Wed, 30 Oct 2024 16:36:19 +0000, Raghavendra Rao Ananta wrote: >=20 > On Wed, Oct 30, 2024 at 1:22=E2=80=AFAM Marc Zyngier wro= te: > > > > On Wed, 30 Oct 2024 00:16:48 +0000, > > Raghavendra Rao Ananta wrote: > > > > > > On Tue, Oct 29, 2024 at 11:47=E2=80=AFAM Marc Zyngier wrote: > > > > > > > > On Tue, 29 Oct 2024 17:06:09 +0000, > > > > Raghavendra Rao Ananta wrote: > > > > > > > > > > On Tue, Oct 29, 2024 at 9:27=E2=80=AFAM Marc Zyngier wrote: > > > > > > > > > > > > On Mon, 28 Oct 2024 23:45:33 +0000, > > > > > > Raghavendra Rao Ananta wrote: > > > > > > > > > > > > > Did you have a chance to check whether this had any negative im= pact on > > > > > > actual workloads? Since the entry/exit code is a bit of a hot s= pot, > > > > > > I'd like to make sure we're not penalising the common case (I o= nly > > > > > > wrote this patch while waiting in an airport, and didn't test i= t at > > > > > > all). > > > > > > > > > > > I ran the kvm selftests, kvm-unit-tests and booted a linux guest = to > > > > > test the change and noticed no failures. > > > > > Any specific test you want to try out? > > > > > > > > My question is not about failures (I didn't expect any), but > > > > specifically about *performance*, and whether checking the flag > > > > without a static key can lead to any performance drop on the hot pa= th. > > > > > > > > Can you please run an exit-heavy workload (such as hackbench, for > > > > example), and report any significant delta you could measure? > > > > > > Oh, I see. I ran hackbench and micro-bench from kvm-unit-tests (which > > > also causes a lot of entry/exits), on Ampere Altra with kernel at > > > v6.12-rc1, and see no significant difference in perf. > > > > Thanks for running this stuff. > > > > > timer_10ms 231040.0 = 902.0 > > > timer_10ms 234120.0 = 914.0 > > > > This seems to be the only case were we are adversely affected by this > > change. > Hmm, I'm not sure how much we want to trust this comparison. For > instance, I just ran micro-bench again a few more times and here are > the outcomes of timer_10ms for each try with the patch: >=20 > Tries total ns > avg ns > -------------------------------------------------------------------------= ---------- > 1_timer_10ms 231840.0 = 905.0 > 2_timer_10ms 234560.0 = 916.0 > 3_timer_10ms 227440.0 = 888.0 > 4_timer_10ms 236640.0 = 924.0 > 5_timer_10ms 231200.0 = 903.0 >=20 > Here's a few on the baseline: >=20 > Tries total ns > avg ns > -------------------------------------------------------------------------= ---------- > 1_timer_10ms 231080.0 = 902.0 > 2_timer_10ms 238040.0 = 929.0 > 3_timer_10ms 231680.0 = 905.0 > 4_timer_10ms 229280.0 = 895.0 > 5_timer_10ms 228520.0 = 892.0 OK, so this benchmark is all over the place, and we can't derive much from it. > > In the grand scheme of thins, that's noise. But this gives us > > a clear line of sight for the removal of the in-kernel interrupts back > > to userspace. > Sorry, I didn't follow you completely on this part. Just me moaning. The code that was gated by the static key that you just removed is used to signal interrupts from the kernel back to userspace, and I'm resisting the urge to remove it altogether now. M. --=20 Without deviation from the norm, progress is not possible.