All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Ryan Roberts <ryan.roberts@arm.com>
Cc: Wanpeng Li <wanpengli@tencent.com>,
	kvm@vger.kernel.org, Roman Gushchin <roman.gushchin@linux.dev>,
	Michal Hocko <mhocko@kernel.org>,
	Shaoqin <shaoqin.huang@intel.com>,
	linux-mm@kvack.org, Zefan Li <lizefan.x@bytedance.com>,
	kvmarm@lists.cs.columbia.edu, Joerg Roedel <joro@8bytes.org>,
	Shakeel Butt <shakeelb@google.com>,
	cgroups@vger.kernel.org, nd@arm.com, Huang@google.com,
	linux-arm-kernel@lists.infradead.org,
	Jim Mattson <jmattson@google.com>,
	Yosry Ahmed <yosryahmed@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	Johannes Weiner <hannes@cmpxchg.org>, Tejun Heo <tj@kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>
Subject: Re: [PATCH v7 4/4] KVM: arm64/mmu: count KVM s2 mmu usage in secondary pagetable stats
Date: Wed, 24 Aug 2022 15:24:57 +0100	[thread overview]
Message-ID: <87zgftra6e.wl-maz@kernel.org> (raw)
In-Reply-To: <319904e0-3722-8ab1-cf74-491b9c32e23b@arm.com>

On Wed, 24 Aug 2022 14:43:43 +0100,
Ryan Roberts <ryan.roberts@arm.com> 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 <yosryahmed@google.com>
> > Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
> > Reviewed-by: Marc Zyngier <maz@kernel.org>
> > ---
> 
> 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.

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Ryan Roberts <ryan.roberts@arm.com>
Cc: Wanpeng Li <wanpengli@tencent.com>,
	kvm@vger.kernel.org, Roman Gushchin <roman.gushchin@linux.dev>,
	Michal Hocko <mhocko@kernel.org>,
	Shaoqin <shaoqin.huang@intel.com>,
	linux-mm@kvack.org, Zefan Li <lizefan.x@bytedance.com>,
	kvmarm@lists.cs.columbia.edu, Joerg Roedel <joro@8bytes.org>,
	Shakeel Butt <shakeelb@google.com>,
	cgroups@vger.kernel.org, nd@arm.com, Huang@google.com,
	linux-arm-kernel@lists.infradead.org,
	Jim Mattson <jmattson@google.com>,
	Yosry Ahmed <yosryahmed@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	Johannes Weiner <hannes@cmpxchg.org>, Tejun Heo <tj@kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>
Subject: Re: [PATCH v7 4/4] KVM: arm64/mmu: count KVM s2 mmu usage in secondary pagetable stats
Date: Wed, 24 Aug 2022 15:24:57 +0100	[thread overview]
Message-ID: <87zgftra6e.wl-maz@kernel.org> (raw)
In-Reply-To: <319904e0-3722-8ab1-cf74-491b9c32e23b@arm.com>

On Wed, 24 Aug 2022 14:43:43 +0100,
Ryan Roberts <ryan.roberts@arm.com> 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 <yosryahmed@google.com>
> > Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
> > Reviewed-by: Marc Zyngier <maz@kernel.org>
> > ---
> 
> 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.
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Ryan Roberts <ryan.roberts@arm.com>
Cc: Yosry Ahmed <yosryahmed@google.com>, Tejun Heo <tj@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Zefan Li <lizefan.x@bytedance.com>,
	James Morse <james.morse@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@kernel.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Shakeel Butt <shakeelb@google.com>,
	Oliver Upton <oupton@google.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Huang@google.com, Shaoqin <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
Subject: Re: [PATCH v7 4/4] KVM: arm64/mmu: count KVM s2 mmu usage in secondary pagetable stats
Date: Wed, 24 Aug 2022 15:24:57 +0100	[thread overview]
Message-ID: <87zgftra6e.wl-maz@kernel.org> (raw)
In-Reply-To: <319904e0-3722-8ab1-cf74-491b9c32e23b@arm.com>

On Wed, 24 Aug 2022 14:43:43 +0100,
Ryan Roberts <ryan.roberts@arm.com> 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 <yosryahmed@google.com>
> > Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
> > Reviewed-by: Marc Zyngier <maz@kernel.org>
> > ---
> 
> 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.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Ryan Roberts <ryan.roberts@arm.com>
Cc: Yosry Ahmed <yosryahmed@google.com>, Tejun Heo <tj@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Zefan Li <lizefan.x@bytedance.com>,
	James Morse <james.morse@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@kernel.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Shakeel Butt <shakeelb@google.com>,
	Oliver Upton <oupton@google.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Huang@google.com, Shaoqin <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
Subject: Re: [PATCH v7 4/4] KVM: arm64/mmu: count KVM s2 mmu usage in secondary pagetable stats
Date: Wed, 24 Aug 2022 15:24:57 +0100	[thread overview]
Message-ID: <87zgftra6e.wl-maz@kernel.org> (raw)
In-Reply-To: <319904e0-3722-8ab1-cf74-491b9c32e23b@arm.com>

On Wed, 24 Aug 2022 14:43:43 +0100,
Ryan Roberts <ryan.roberts@arm.com> 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 <yosryahmed@google.com>
> > Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
> > Reviewed-by: Marc Zyngier <maz@kernel.org>
> > ---
> 
> 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.

  reply	other threads:[~2022-08-24 14:24 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-23  0:46 [PATCH v7 0/4] KVM: mm: count KVM mmu usage in memory stats Yosry Ahmed
2022-08-23  0:46 ` Yosry Ahmed
2022-08-23  0:46 ` Yosry Ahmed
2022-08-23  0:46 ` Yosry Ahmed
     [not found] ` <20220823004639.2387269-1-yosryahmed-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2022-08-23  0:46   ` [PATCH v7 1/4] mm: add NR_SECONDARY_PAGETABLE to count secondary page table uses Yosry Ahmed
2022-08-23  0:46     ` Yosry Ahmed
2022-08-23  0:46     ` Yosry Ahmed
2022-08-23  0:46     ` Yosry Ahmed
2022-08-24 13:41     ` Ryan Roberts
2022-08-24 13:41       ` Ryan Roberts
2022-08-24 13:41       ` Ryan Roberts
2022-08-24 13:41       ` Ryan Roberts
     [not found]       ` <5ac13c91-0e42-533b-42d0-c78573c7aef3-5wv7dgnIgG8@public.gmane.org>
2022-08-24 17:25         ` Yosry Ahmed
2022-08-24 17:25           ` Yosry Ahmed
2022-08-24 17:25           ` Yosry Ahmed
2022-08-24 17:25           ` Yosry Ahmed
     [not found]           ` <CAJD7tkbn7mFvf0oiUKPZtu92GtuMht-s5iPBRfEuUfTxXC_j8Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-08-24 17:40             ` Ryan Roberts
2022-08-24 17:40               ` Ryan Roberts
2022-08-24 17:40               ` Ryan Roberts
2022-08-24 17:40               ` Ryan Roberts
2022-08-23  0:46 ` [PATCH v7 2/4] KVM: mmu: add a helper to account memory used by KVM MMU Yosry Ahmed
2022-08-23  0:46   ` Yosry Ahmed
2022-08-23  0:46   ` Yosry Ahmed
2022-08-23  0:46   ` Yosry Ahmed
2022-08-23  0:46 ` [PATCH v7 3/4] KVM: x86/mmu: count KVM mmu usage in secondary pagetable stats Yosry Ahmed
2022-08-23  0:46   ` Yosry Ahmed
2022-08-23  0:46   ` Yosry Ahmed
2022-08-23  0:46   ` Yosry Ahmed
     [not found]   ` <20220823004639.2387269-4-yosryahmed-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2022-08-26 20:20     ` Sean Christopherson
2022-08-26 20:20       ` Sean Christopherson
2022-08-26 20:20       ` Sean Christopherson
2022-08-26 20:20       ` Sean Christopherson
     [not found]       ` <Ywkq8HYyTI1eStSO-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2022-08-26 21:25         ` Yosry Ahmed
2022-08-26 21:25           ` Yosry Ahmed
2022-08-26 21:25           ` Yosry Ahmed
2022-08-26 21:25           ` Yosry Ahmed
2022-08-30 21:52       ` Sean Christopherson
2022-08-30 21:52         ` Sean Christopherson
2022-08-30 21:52         ` Sean Christopherson
2022-08-30 21:52         ` Sean Christopherson
     [not found]         ` <Yw6GoWY411PrIRMx-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2022-08-30 23:48           ` Yosry Ahmed
2022-08-30 23:48             ` Yosry Ahmed
2022-08-30 23:48             ` Yosry Ahmed
2022-08-30 23:48             ` Yosry Ahmed
2022-08-23  0:46 ` [PATCH v7 4/4] KVM: arm64/mmu: count KVM s2 " Yosry Ahmed
2022-08-23  0:46   ` Yosry Ahmed
2022-08-23  0:46   ` Yosry Ahmed
2022-08-23  0:46   ` Yosry Ahmed
2022-08-24 13:43   ` Ryan Roberts
2022-08-24 13:43     ` Ryan Roberts
2022-08-24 13:43     ` Ryan Roberts
2022-08-24 13:43     ` Ryan Roberts
2022-08-24 14:24     ` Marc Zyngier [this message]
2022-08-24 14:24       ` Marc Zyngier
2022-08-24 14:24       ` Marc Zyngier
2022-08-24 14:24       ` Marc Zyngier
     [not found]       ` <87zgftra6e.wl-maz-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2022-08-24 17:03         ` Ryan Roberts
2022-08-24 17:03           ` Ryan Roberts
2022-08-24 17:03           ` Ryan Roberts
2022-08-24 17:03           ` Ryan Roberts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zgftra6e.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=Huang@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lizefan.x@bytedance.com \
    --cc=mhocko@kernel.org \
    --cc=nd@arm.com \
    --cc=pbonzini@redhat.com \
    --cc=roman.gushchin@linux.dev \
    --cc=ryan.roberts@arm.com \
    --cc=shakeelb@google.com \
    --cc=shaoqin.huang@intel.com \
    --cc=tj@kernel.org \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=yosryahmed@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.