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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDA87C05027 for ; Tue, 14 Feb 2023 16:50:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232792AbjBNQun (ORCPT ); Tue, 14 Feb 2023 11:50:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232620AbjBNQu2 (ORCPT ); Tue, 14 Feb 2023 11:50:28 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECC492DE6B; Tue, 14 Feb 2023 08:49:57 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 4D562B81E19; Tue, 14 Feb 2023 16:49:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03DCBC433D2; Tue, 14 Feb 2023 16:49:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676393395; bh=VOL3JjZ0vCFMw4tap3lcI2oqdtHPOHwXJysYrZRiOrs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eAuFVRf3OMkEv8ngfGxI9zuVKWsaRMzDY37GCFLCxI3tUFhr4j0osd5W8MxcQSIku wvPNUoqGz+GvJ6Wm0bFi8DLhgjDjzuHweR1Ht/OPLAAXZVFCS8+EBrQTDDUQ9Wq0Tt NdwxVig/N16clujaFvUudPYeZsQqGJzOMGKy8jHIZe0+SGc1ou2Srf0nAdHJunIhhh 4GgtaNG8CXgCqCldXCwELuxMSd5FxkRsao7v9dwYT7qjtTR9IeUKkPrlXWd+xWvsgS NDZFwE5Q3VV5ikwYwPANDP+Gmqljx/eDsdwX9bE3loP0dZet40d8PpjxI9aF+q1dTG x+l8TPo+fKOGg== 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 1pRyV5-00AMdC-LW; Tue, 14 Feb 2023 16:49:51 +0000 Date: Tue, 14 Feb 2023 16:49:51 +0000 Message-ID: <86zg9gxkcw.wl-maz@kernel.org> From: Marc Zyngier To: Usama Arif Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-doc@vger.kernel.org, virtualization@lists.linux-foundation.org, linux@armlinux.org.uk, yezengruan@huawei.com, catalin.marinas@arm.com, will@kernel.org, steven.price@arm.com, mark.rutland@arm.com, bagasdotme@gmail.com, pbonzini@redhat.com, fam.zheng@bytedance.com, liangma@liangbit.com, punit.agrawal@bytedance.com Subject: Re: [v3 0/6] KVM: arm64: implement vcpu_is_preempted check In-Reply-To: <5976b0c9-d4e7-7561-6ce0-790e2460d1ef@bytedance.com> References: <20230117102930.1053337-1-usama.arif@bytedance.com> <5976b0c9-d4e7-7561-6ce0-790e2460d1ef@bytedance.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") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: usama.arif@bytedance.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-doc@vger.kernel.org, virtualization@lists.linux-foundation.org, linux@armlinux.org.uk, yezengruan@huawei.com, catalin.marinas@arm.com, will@kernel.org, steven.price@arm.com, mark.rutland@arm.com, bagasdotme@gmail.com, pbonzini@redhat.com, fam.zheng@bytedance.com, liangma@liangbit.com, punit.agrawal@bytedance.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Feb 2023 16:06:26 +0000, Usama Arif wrote: > > > > On 17/01/2023 10:29, Usama Arif wrote: > > This patchset adds support for vcpu_is_preempted in arm64, which allows the guest > > to check if a vcpu was scheduled out, which is useful to know incase it was > > holding a lock. vcpu_is_preempted is well integrated in core kernel code and can > > be used to improve performance in locking (owner_on_cpu usage in mutex_spin_on_owner, > > mutex_can_spin_on_owner, rtmutex_spin_on_owner and osq_lock) and scheduling > > (available_idle_cpu which is used in several places in kernel/sched/fair.c > > for e.g. in wake_affine to determine which CPU can run soonest). > > > > This patchset shows significant improvement on overcommitted hosts (vCPUs > pCPUS), > > as waiting for preempted vCPUs reduces performance. > > > > Hi, > > Just wanted to check if there are any comments for this? Not a lot, I'm afraid. My concerns with this thing are still the same: - it is KVM-specific - it doesn't work with nested virtualisation - its correctness is unproven on arm64 I'm also not going to entertain any of this without the core arm64 maintainers saying that they will enable this. Thanks, M. -- Without deviation from the norm, progress is not possible.