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 4530AC32793 for ; Wed, 24 Aug 2022 14:25:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239142AbiHXOZT (ORCPT ); Wed, 24 Aug 2022 10:25:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239157AbiHXOZM (ORCPT ); Wed, 24 Aug 2022 10:25:12 -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 D4050BF6C; Wed, 24 Aug 2022 07:25:09 -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 6268D6181B; Wed, 24 Aug 2022 14:25:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B45EEC433C1; Wed, 24 Aug 2022 14:25:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661351108; bh=GlyJJ9dV5dcNN4e8F/+zW4aKoVpKrRpQG5FduS6xj60=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RlOFCFyOYvgDsmtvh7bI4fnzpALdN2M/t7Sdx3OBkKjuNIOEGaxCSeasH5M/MQcVu 39MlyXzAx5P4sTw6vHcANvoZt5XNpo4DlF7c3sYHlUc18EhnOJ+Nx/MvsFzgmvBHY4 mnjdD22AawdV/zG7YInQPGZCdQ59QpasRPsWlEDIns2MvGoYCbBB1Zlc8Zx17VlJKx WlpiSr2SvuWNUu+CiU1aCrccEOnvIj7LHy6SiOm7h2HB/+9dhcnJIKX7ihFSu2bagl 8lmZ+3PVbzSvTHGsjmudsOHkifF0MknUFCc1OryZ69NDWLBrFdNJWFGyy08RVV1UqF GXox+Ellgocog== Received: from [12.191.126.171] (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 1oQrJa-005SYH-2A; Wed, 24 Aug 2022 15:25:06 +0100 Date: Wed, 24 Aug 2022 15:24:57 +0100 Message-ID: <87zgftra6e.wl-maz@kernel.org> From: Marc Zyngier To: Ryan Roberts Cc: Yosry Ahmed , Tejun Heo , Johannes Weiner , Zefan Li , James Morse , Alexandru Elisei , Suzuki K Poulose , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Andrew Morton , Michal Hocko , Roman Gushchin , Shakeel Butt , Oliver Upton , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Huang@google.com, Shaoqin , linux-mm@kvack.org, cgroups@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, nd@arm.com Subject: Re: [PATCH v7 4/4] KVM: arm64/mmu: count KVM s2 mmu usage in secondary pagetable stats In-Reply-To: <319904e0-3722-8ab1-cf74-491b9c32e23b@arm.com> References: <20220823004639.2387269-1-yosryahmed@google.com> <20220823004639.2387269-5-yosryahmed@google.com> <319904e0-3722-8ab1-cf74-491b9c32e23b@arm.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: 12.191.126.171 X-SA-Exim-Rcpt-To: ryan.roberts@arm.com, yosryahmed@google.com, tj@kernel.org, hannes@cmpxchg.org, lizefan.x@bytedance.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, pbonzini@redhat.com, seanjc@google.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, akpm@linux-foundation.org, mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, oupton@google.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Huang@google.com, shaoqin.huang@intel.com, linux-mm@kvack.org, cgroups@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, nd@arm.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 Wed, 24 Aug 2022 14:43:43 +0100, Ryan Roberts wrote: > > > Count the pages used by KVM in arm64 for stage2 mmu in memory stats > > under secondary pagetable stats (e.g. "SecPageTables" in /proc/meminfo) > > to give better visibility into the memory consumption of KVM mmu in a > > similar way to how normal user page tables are accounted. > > > > Signed-off-by: Yosry Ahmed > > Reviewed-by: Oliver Upton > > Reviewed-by: Marc Zyngier > > --- > > I see that you are not including the memory reserved for the host > stage2 table when using protected KVM. Is this something worth adding? > (See arch/arm64/kvm/pkvm.c:kvm_hyp_reserve()). > > This reservation is done pretty early on in bootmem_init() so not sure > if this could cause some init ordering issues that might be tricky to > solve though. I also don't see what this buys us. This memory can't be reclaimed, and is not part of KVM's job for the purpose of running guests, which is what this series is about. If anything, it should be accounted separately. M. -- Without deviation from the norm, progress is not possible.