public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Wanpeng Li <kernellwp@gmail.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	Ben Gardon <bgardon@google.com>,
	Shakeel Butt <shakeelb@google.com>
Subject: Re: [PATCH] KVM: arm: memcg awareness
Date: Wed, 17 Mar 2021 10:53:38 +0000	[thread overview]
Message-ID: <87im5qhwzx.wl-maz@kernel.org> (raw)
In-Reply-To: <e5fce698-9e21-5c71-c99b-a9af3f213e8f@redhat.com>

On Wed, 17 Mar 2021 10:40:23 +0000,
Paolo Bonzini <pbonzini@redhat.com> wrote:
> 
> On 17/03/21 10:10, Marc Zyngier wrote:
> >> @@ -366,7 +366,7 @@ static int hyp_map_walker(u64 addr, u64 end, u32 level, kvm_pte_t *ptep,
> >>   	if (WARN_ON(level == KVM_PGTABLE_MAX_LEVELS - 1))
> >>   		return -EINVAL;
> >>   -	childp = (kvm_pte_t *)get_zeroed_page(GFP_KERNEL);
> >> +	childp = (kvm_pte_t *)get_zeroed_page(GFP_KERNEL_ACCOUNT);
> > No, this is wrong.
> > 
> > You cannot account the hypervisor page tables to the guest because we
> > don't ever unmap them, and that we can't distinguish two data
> > structures from two different VMs occupying the same page.
> 
> If you never unmap them, there should at least be a shrinker to get
> rid of unused pages in the event of memory pressure.

We don't track where these pages are coming from or whether they can
safely be unmapped. Until we can track such ownership and deal with
page sharing, these mappings have to stay,

At most, this represent the amount of memory required to map the whole
of the linear mapping.

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2021-03-17 10:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17  5:46 [PATCH] KVM: arm: memcg awareness Wanpeng Li
2021-03-17  7:57 ` Michal Hocko
2021-03-17  8:04   ` Wanpeng Li
2021-03-17  8:04     ` Wanpeng Li
2021-03-17  9:44       ` Michal Hocko
2021-03-17  9:15     ` Marc Zyngier
2021-03-17  9:10 ` Marc Zyngier
2021-03-17 10:40   ` Paolo Bonzini
2021-03-17 10:53     ` Marc Zyngier [this message]
2021-03-17 10:55       ` Paolo Bonzini
2021-03-17 11:03         ` Marc Zyngier

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=87im5qhwzx.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=bgardon@google.com \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=shakeelb@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox