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 0EFD7C4332F for ; Sun, 6 Nov 2022 16:37:07 +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=r8e54sbvloczvDSmp3Z66qxiCtLxcTFz82lBM0JQ/Kc=; b=1YACAAITWtUdiy 4J0wz1rRy6XhwDGl617f4m9lJVasMjCtWyFZ5jOov2T0fsvUJpvMljqt3348+GNaxMhJMGawU33YE R9VQcJ+nZEl3iDtJ/r8I5FwFxCGkReJcLh2le28d2Igrb+57v07FGzqpFCIYAyfBygg+i4scnpDKl xd8L6Psmtv6OTs2n0gh9/q7mXxnSFAHszI9XVA/7Wk7vBN1zE2anyCJKVERMOfG+vf3lLzuiTvbij 1dGlkO+GOZz7MpuskK+3+OtCsH/m8inasHSZLF5VGhQfJBvl1TZbeHhHxnX1izuXm0po7RzR1QUTR DyED6zWewKC9MifwAiDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oricp-008pHb-9k; Sun, 06 Nov 2022 16:35:59 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oricm-008pFw-CM for linux-arm-kernel@lists.infradead.org; Sun, 06 Nov 2022 16:35:57 +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 ams.source.kernel.org (Postfix) with ESMTPS id C9452B808C7; Sun, 6 Nov 2022 16:35:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EBF5C433D6; Sun, 6 Nov 2022 16:35:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667752551; bh=yNfuDfXWA0vsDbKXvNaTminJH2Wz10lrgd6JPh43Wz0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=I+G48P9XkJFyZHA+9m6Wt55mjwTEeQSRdJ13v8ynfjJDMk2/WFt1uGnTcNoxR+Bm+ uMKazx0BUfghbhA+ZxWjgNyL/qmfKuQE/V71hUlhD/CIWUMoLpAJWteycn59+Eew2X NVfAWezc+wXtHPj3eqXuX1o1EXP6JXj8HO/PleCdz5ITWsrHxDixtBfSWEN3T1LZU5 OJLa/wq+qWCCmgQdxPBGf2DmMrji48zvcsLc/du8IshwleTW1Ta8+RYyU6EcRN1Bak CiIXVD3ll+KOt2sCn57mYlP1uy5QKAO8/vJzyp5TpS2d8B9ny1yMqtoEuFeiRjkFIG KkDbRMYRCYQjw== Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.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 1oricf-004DkL-2N; Sun, 06 Nov 2022 16:35:49 +0000 Date: Sun, 06 Nov 2022 16:35:21 +0000 Message-ID: <87k048f3cm.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, fam.zheng@bytedance.com, liangma@liangbit.com, punit.agrawal@bytedance.com Subject: Re: [v2 0/6] KVM: arm64: implement vcpu_is_preempted check In-Reply-To: <20221104062105.4119003-1-usama.arif@bytedance.com> References: <20221104062105.4119003-1-usama.arif@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/27.1 (x86_64-pc-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: 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, 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221106_083556_590257_B917BC65 X-CRM114-Status: GOOD ( 18.02 ) 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 Fri, 04 Nov 2022 06:20:59 +0000, 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 can > be used to improve performance in locking (see owner_on_cpu usage in > mutex_spin_on_owner, mutex_can_spin_on_owner, rtmutex_spin_on_owner > and osq_lock) and scheduling (see 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): [...] > pvcy shows a smaller overall improvement (50%) compared to > vcpu_is_preempted (277%). Host side flamegraph analysis shows that > ~60% of the host time when using pvcy is spent in kvm_handle_wfx, > compared with ~1.5% when using vcpu_is_preempted, hence > vcpu_is_preempted shows a larger improvement. And have you worked out *why* we spend so much time handling WFE? 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