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 724F7CA5FEC for ; Sat, 3 Oct 2026 14:53:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type: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=l6e5SFKNalWkFlh1k64I5ENSGoQuN42StaikJNmYu/8=; b=FNCc+1OSLusBWjiY9Ng+tS/nqC 8AeniFoaljIKgFdE5RFpX+EQb+NTuj9ZJOF9zpzB5xt0wHxP6CfXOH/4g7Ov4VNQL0RQgADQ0kxiC N+9/o8pauqE5viNYtjBHhRh2KBDZ3KRPpZvhJatAoPb6llqzGVFI33+4ty2PnOnp+VDn1Ku6jFlxc 2bsFSwdqOJks0w4qiMAqMO9Po2In+eIKeob0znUS5rb+qiKDnH70ceZrh0xCTEtBS4P40LOhyimfj jtGmGZlzRgW0czrg172uXAUvjsZSW/NPZSvfXP9elTktgKwqJbkOk2eyPkbNdCsoar2jVn63qXoSe gireD93A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xD17N-0000000DePY-1Uw2; Sat, 03 Oct 2026 14:53:41 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xD17G-0000000DeOf-3bHn for linux-arm-kernel@lists.infradead.org; Sat, 03 Oct 2026 14:53:37 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 42290439B5; Sat, 3 Oct 2026 14:53:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 230A01F0089B; Sat, 3 Oct 2026 14:53:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1791039214; bh=l6e5SFKNalWkFlh1k64I5ENSGoQuN42StaikJNmYu/8=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=cLtAPnfQRzeVvQpcgjqON68hdJlGOOtb+HQOBeqRbacGFSAFTRUITk0/wliohlVT7 c7KIJlOZaonbgsobntYRapJmnt7vDZj8REwnScMH18aDGTJFC+v5mryxXGy0/krzba 2MeIQ0DzDoaZlAFt7rj4rTJY8pZI4SZ/4F5OpsqSSChAziFmJiMMDbqsDPzDeHGsCt 6Pa9/6rKR5n1Wr84E4vJqusAP8YVeGAqSNDr2o4Txhl0Jip5KJDLyLGN7+gRvg+0Am VXTr/V2jvauKeV+X4+nE2LCKp75mS0+GUWrbdlta3TyjCoSN/ZB6JjWPra7sd+xV1W PeiT91ayiDD3Q== 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.98.2) (envelope-from ) id 1xD17D-0000000GYMi-3OEA; Sat, 03 Oct 2026 14:53:31 +0000 Date: Sat, 03 Oct 2026 15:53:31 +0100 Message-ID: <86ece63kes.wl-maz@kernel.org> From: Marc Zyngier To: Yize Wang Cc: , , , , , , , , , , , , , Subject: Re: [PATCH 0/2] Batch register access for live migration optimization In-Reply-To: References: <20260918081930.4014735-1-wangyize7@huawei.com> <861paq69te.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/30.1 (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=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: wangyize7@huawei.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, fuad.tabba@linux.dev, joey.gouly@arm.com, seiden@linux.ibm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, mark.rutland@arm.com, zhengchuan@huawei.com, jiangjiacheng@huawei.com, yize_w1110@163.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, 20 Sep 2026 10:15:25 +0100, Yize Wang wrote: >=20 > =E5=9C=A8 2026/9/18 20:08, Marc Zyngier =E5=86=99=E9=81=93: > > On Fri, 18 Sep 2026 09:18:13 +0100, > > Yize Wang wrote: > >> This series adds batch register access support to KVM/arm64 to reduce > >> syscall overhead during VM live migration. > >>=20 > >> Currently, QEMU issues one ioctl per register when saving/restoring VG= IC > >> state. On large VM configurations this means tens of thousands of sysc= alls, > >> where lock acquisition and context switch overhead dominates migration > >> downtime. Thus, we provide a batch register method to allow userspace > >> read/write multiple distributor and redistributor registers in a singl= e call. > >> In this way, we can significantly reduce syscalls and migration downti= me. > >>=20 > >> Test the VM migration time under pressure conditions. > >> The VM specifications for migration are as follows: > >> - VM use 4-K page; > >> - the number of VCPU is 160; > >> - the total memory is 320Gigabit; > >> - use 'Redis SET-benchmark' to pressurize VM; > >>=20 > >> Performance results (3-run average, ms): > >> | Metric | Without patch | With patch | Improvement | > >> |---------------------|---------------|------------|-------------| > >> | Migration downtime | 536 | 321 | 40% | > >> | Source (total) | 344 | 230 | 33% | > >> | - VGIC put | 158 | 40 | 75% | > >> | - VGIC get | 120 | 19 | 84% | > >> | Destination (total) | 192 | 91 | 53% | > >> | - VGIC put | 132 | 27 | 80% | > >>=20 > >> Yize Wang (2): > >> KVM: arm64: Add batch group constant and data structure to UAPI hea= der > >> KVM: arm64: Add VGIC v3 batch register access implementation > > Questions: > >=20 > > - Why only the MMIO registers? > >=20 > > - Why not the sysregs? > >=20 > > - Why only the GIC? > >=20 > > - Why not all of the state? > >=20 > > - Where is the corresponding userspace code? > >=20 > > More importantly, since this is about batching system calls: > >=20 > > - Why can't this be done with io_uring instead? > >=20 > > M. >=20 >=20 > Hi, Marc! Thank you for the review. >=20 > =C2=A0 These patches focus on optimizing GICv3 register access during live > migration. We found that there are a large number of locks (kvm->lock, > vcpus, config_lock) in the GIC, these lock operations wil cost large > time waste. The batches of sysreg for vcpu optimization will come in > follow as a separate series. And let me address these questions one by > one. All these locks should be non-blocking by the time you save anything related to the GIC, because: - none of the vcpu can be running - this must be a single threaded operation So if you are seeing anything contended, this is either the sign of a bad KVM bug, or an indication that you are violating the above requirements. M. --=20 Without deviation from the norm, progress is not possible.