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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8138BC433EF for ; Tue, 24 May 2022 07:14:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234746AbiEXHOf (ORCPT ); Tue, 24 May 2022 03:14:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234875AbiEXHOd (ORCPT ); Tue, 24 May 2022 03:14:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1FF1954A0 for ; Tue, 24 May 2022 00:14:30 -0700 (PDT) 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 5B14F61546 for ; Tue, 24 May 2022 07:14:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8CEEC385AA; Tue, 24 May 2022 07:14:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653376469; bh=LxRqpQ27FRfp6NTohzs+bzZMXzMCkXQtpRiK1TcYXfM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=EszX3WzlYrRKLWtmawFcLVuHmOL09be9KGnpbhRBEl1X5YaAYAU8kisDfhNQDnFxw XAE7iZsQWR5Srgay4WNp6WmYKsCEanlMNqCuMmT6piYzpkLTyWRLgLCb2WgWrO+uIi y3/W9JYtLKhZqUFCKvOx53tOANbQc9G/SNLcs6xJwS2M5wXiSsUW+Gbi4VjOx48hBr 3YwPjn9xuIFu88F6LNMguAvIGnhjePAUltqvJPQCkbu13NueP1upL3Mk57y+jtlN8q aZsQ6qmPtj+LHuoJuqLYJgm/1o/vZSU52akcTacUOlqyTHhjht6iF+0aHwL9e9Zjsq HUr+QezbmaQ8g== Received: from athedsl-362076.home.otenet.gr ([87.202.142.23] 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.94.2) (envelope-from ) id 1ntOkN-00DLT7-AI; Tue, 24 May 2022 08:14:27 +0100 Date: Tue, 24 May 2022 08:14:24 +0100 Message-ID: <87fskzmmgf.wl-maz@kernel.org> From: Marc Zyngier To: Shivam Kumar Cc: pbonzini@redhat.com, seanjc@google.com, james.morse@arm.com, borntraeger@linux.ibm.com, david@redhat.com, kvm@vger.kernel.org, Shaju Abraham , Manish Mishra , Anurag Madnawat Subject: Re: [PATCH v4 2/4] KVM: arm64: Dirty quota-based throttling of vcpus In-Reply-To: <20220521202937.184189-3-shivam.kumar1@nutanix.com> References: <20220521202937.184189-1-shivam.kumar1@nutanix.com> <20220521202937.184189-3-shivam.kumar1@nutanix.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") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 87.202.142.23 X-SA-Exim-Rcpt-To: shivam.kumar1@nutanix.com, pbonzini@redhat.com, seanjc@google.com, james.morse@arm.com, borntraeger@linux.ibm.com, david@redhat.com, kvm@vger.kernel.org, shaju.abraham@nutanix.com, manish.mishra@nutanix.com, anurag.madnawat@nutanix.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: kvm@vger.kernel.org On Sat, 21 May 2022 21:29:38 +0100, Shivam Kumar wrote: > > Exit to userspace whenever the dirty quota is exhausted (i.e. dirty count > equals/exceeds dirty quota) to request more dirty quota. > > Suggested-by: Shaju Abraham > Suggested-by: Manish Mishra > Co-developed-by: Anurag Madnawat > Signed-off-by: Anurag Madnawat > Signed-off-by: Shivam Kumar > --- > arch/arm64/kvm/arm.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c > index ecc5958e27fe..5b6a239b83a5 100644 > --- a/arch/arm64/kvm/arm.c > +++ b/arch/arm64/kvm/arm.c > @@ -848,6 +848,9 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) > ret = 1; > run->exit_reason = KVM_EXIT_UNKNOWN; > while (ret > 0) { > + ret = kvm_vcpu_check_dirty_quota(vcpu); > + if (!ret) > + break; > /* > * Check conditions before entering the guest > */ Why do we need yet another check on the fast path? It seems to me that this is what requests are for, so I'm definitely not keen on this approach. I certainly do not want any extra overhead for something that is only used on migration. If anything, it is the migration path that should incur the overhead. M. -- Without deviation from the norm, progress is not possible.