public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Peng Zhang <zhangpeng.00@bytedance.com>
Cc: pbonzini@redhat.com, chao.p.peng@linux.intel.com,
	Liam.Howlett@oracle.com,  kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org,  maple-tree@lists.infradead.org
Subject: Re: [PATCH RFC] KVM: Use maple tree to manage memory attributes.
Date: Thu, 22 Aug 2024 09:51:52 -0700	[thread overview]
Message-ID: <ZsdsqHOtsMDSWMuC@google.com> (raw)
In-Reply-To: <20240822065544.65013-1-zhangpeng.00@bytedance.com>

On Thu, Aug 22, 2024, Peng Zhang wrote:
> Currently, xarray is used to manage memory attributes. The memory
> attributes management here is an interval problem. However, xarray is
> not suitable for handling interval problems. It may cause memory waste
> and is not efficient. Switching it to maple tree is more elegant. Using
> maple tree here has the following three advantages:
> 1. Less memory overhead.
> 2. More efficient interval operations.
> 3. Simpler code.
> 
> This is the first user of the maple tree interface mas_find_range(),
> and it does not have any test cases yet, so its stability is unclear.
> 
> Signed-off-by: Peng Zhang <zhangpeng.00@bytedance.com>
> ---
>  include/linux/kvm_host.h |  5 +++--
>  virt/kvm/kvm_main.c      | 47 ++++++++++++++--------------------------
>  2 files changed, 19 insertions(+), 33 deletions(-)
> 
> I haven't tested this code yet, and I'm not very familiar with kvm, so I'd
> be happy if someone could help test it. This is just an RFC now. Any comments
> are welcome.

Unfortunatley, you are unlikely to get much feedback (although Matthew already
jumped in).  We (KVM folks) know the xarray usage for memory attribute is
(very) suboptimal, and it's on the todo list to address.  We specifically went
with a simple-but-slow implementation in order to prioritize correctness above
all else for initial merge.

  parent reply	other threads:[~2024-08-22 16:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-22  6:55 [PATCH RFC] KVM: Use maple tree to manage memory attributes Peng Zhang
2024-08-22  7:30 ` Peng Zhang
2024-08-22 17:02   ` Liam R. Howlett
2024-08-22 15:59 ` Matthew Wilcox
2024-08-22 16:51 ` Sean Christopherson [this message]
2024-08-22 17:00 ` Liam R. Howlett

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=ZsdsqHOtsMDSWMuC@google.com \
    --to=seanjc@google.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=chao.p.peng@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maple-tree@lists.infradead.org \
    --cc=pbonzini@redhat.com \
    --cc=zhangpeng.00@bytedance.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