From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 100B5C761A6 for ; Tue, 4 Apr 2023 20:50:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=v6+tA8XyUROujDMiw3cUZ+BoPfebjV37vey8NKf6Ze4=; b=ea40EcWGoyzjte TfZvEFkf6XFyjgCoPj5HREiMAMhIsF8UBHFgWTUuKCx0MnHrN13kwjafmUCpn5zPc++hch7G5UU4X Bo+OHod5hXz4uA1AaIuwQOykMqz/TtbCOjBplfDEsJ9Da8QEeW+e35Idtvf7xX0jOFTx8jccGGU0P fRAQaYxGUoz2mI+0UENy12yxuqURyprpYr3NyOu+8U6mbpAcj/6F/IgFVmkyqZbzFD3VKZXmnuS9F b6HoTnbdM1J70QrfGFDkikc5EoxkYf4tRSUDoMAjUfXmufCafHt0kKOxARo1crpChXxrlZHnJBCm6 Q3Xrn7u3+cmaV4uGRqbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pjnaf-002qK7-0n; Tue, 04 Apr 2023 20:49:17 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pjnac-002qJP-2n for linux-arm-kernel@lists.infradead.org; Tue, 04 Apr 2023 20:49:16 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 62D98639BD; Tue, 4 Apr 2023 20:49:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA3AEC4339B; Tue, 4 Apr 2023 20:49:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680641353; bh=gXqIcJnn5Eq5okLMpDEb9nxUz3SeXdgGCHq7sJi3mH4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CtyWHrJha0wN1fTMK3NpqKRCmt11CL56a5Z8muzaCRqQWsJy7r5Y9Yl3zLU3fjyEH hCDUmR6dQQLAq46HmHA6CY8AoaY/rVu5X32EsbMOstevgFcKnTuG0gLwkzdZB3ilhp vjkw8Vm3SSrNv1Zlb0k9XyLj4TO3GqQ+Kg8tLl2XiVq/csKBVyaa6pDCfw9j9gktnZ u1CgwUF4S/IlC4auLKpQzclYprcp5T9wsRxFoiyfHfDUhWhKV15DJCXOGGI8vJX8UQ qrtkRfFEMJ/qgcTxiAzvcJoC7l3oAfhnMFG2mV3pn8/ejQj2NUOY8ghg/wSfjoHNOv YvdRLhNXBpsRA== 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 1pjnaZ-005l6L-AO; Tue, 04 Apr 2023 21:49:11 +0100 Date: Tue, 04 Apr 2023 21:49:10 +0100 Message-ID: <86sfdfv0e1.wl-maz@kernel.org> From: Marc Zyngier To: David Dai , Oliver Upton Cc: "Rafael J. Wysocki" , Viresh Kumar , Rob Herring , Krzysztof Kozlowski , Paolo Bonzini , Jonathan Corbet , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , kernel-team@android.com, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Subject: Re: [RFC PATCH 0/6] Improve VM DVFS and task placement behavior In-Reply-To: References: <20230330224348.1006691-1-davidai@google.com> 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/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: davidai@google.com, oliver.upton@linux.dev, rafael@kernel.org, viresh.kumar@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, pbonzini@redhat.com, corbet@lwn.net, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, lpieralisi@kernel.org, sudeep.holla@arm.com, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, kernel-team@android.com, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230404_134914_982856_D1E61694 X-CRM114-Status: GOOD ( 30.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 04 Apr 2023 20:43:40 +0100, Oliver Upton wrote: > > Folks, > > On Thu, Mar 30, 2023 at 03:43:35PM -0700, David Dai wrote: > > > > > PCMark > > Higher is better > > +-------------------+----------+------------+--------+-------+--------+ > > | Test Case (score) | Baseline | Hypercall | %delta | MMIO | %delta | > > +-------------------+----------+------------+--------+-------+--------+ > > | Weighted Total | 6136 | 7274 | +19% | 6867 | +12% | > > +-------------------+----------+------------+--------+-------+--------+ > > | Web Browsing | 5558 | 6273 | +13% | 6035 | +9% | > > +-------------------+----------+------------+--------+-------+--------+ > > | Video Editing | 4921 | 5221 | +6% | 5167 | +5% | > > +-------------------+----------+------------+--------+-------+--------+ > > | Writing | 6864 | 8825 | +29% | 8529 | +24% | > > +-------------------+----------+------------+--------+-------+--------+ > > | Photo Editing | 7983 | 11593 | +45% | 10812 | +35% | > > +-------------------+----------+------------+--------+-------+--------+ > > | Data Manipulation | 5814 | 6081 | +5% | 5327 | -8% | > > +-------------------+----------+------------+--------+-------+--------+ > > > > PCMark Performance/mAh > > Higher is better > > +-----------+----------+-----------+--------+------+--------+ > > | | Baseline | Hypercall | %delta | MMIO | %delta | > > +-----------+----------+-----------+--------+------+--------+ > > | Score/mAh | 79 | 88 | +11% | 83 | +7% | > > +-----------+----------+-----------+--------+------+--------+ > > > > Roblox > > Higher is better > > +-----+----------+------------+--------+-------+--------+ > > | | Baseline | Hypercall | %delta | MMIO | %delta | > > +-----+----------+------------+--------+-------+--------+ > > | FPS | 18.25 | 28.66 | +57% | 24.06 | +32% | > > +-----+----------+------------+--------+-------+--------+ > > > > Roblox Frames/mAh > > Higher is better > > +------------+----------+------------+--------+--------+--------+ > > | | Baseline | Hypercall | %delta | MMIO | %delta | > > +------------+----------+------------+--------+--------+--------+ > > | Frames/mAh | 91.25 | 114.64 | +26% | 103.11 | +13% | > > +------------+----------+------------+--------+--------+--------+ > > > > > Next steps: > > =========== > > We are continuing to look into communication mechanisms other than > > hypercalls that are just as/more efficient and avoid switching into the VMM > > userspace. Any inputs in this regard are greatly appreciated. > > We're highly unlikely to entertain such an interface in KVM. > > The entire feature is dependent on pinning vCPUs to physical cores, for which > userspace is in the driver's seat. That is a well established and documented > policy which can be seen in the way we handle heterogeneous systems and > vPMU. > > Additionally, this bloats the KVM PV ABI with highly VMM-dependent interfaces > that I would not expect to benefit the typical user of KVM. > > Based on the data above, it would appear that the userspace implementation is > in the same neighborhood as a KVM-based implementation, which only further > weakens the case for moving this into the kernel. > > I certainly can appreciate the motivation for the series, but this feature > should be in userspace as some form of a virtual device. +1 on all of the above. The one thing I'd like to understand that the comment seems to imply that there is a significant difference in overhead between a hypercall and an MMIO. In my experience, both are pretty similar in cost for a handling location (both in userspace or both in the kernel). MMIO handling is a tiny bit more expensive due to a guaranteed TLB miss followed by a walk of the in-kernel device ranges, but that's all. It should hardly register. And if you really want some super-low latency, low overhead signalling, maybe an exception is the wrong tool for the job. Shared memory communication could be more appropriate. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel