All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>, xen-devel@lists.xen.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: Re: Analysis of using balloon page compaction in Xen balloon driver
Date: Thu, 16 Oct 2014 18:46:36 +0100	[thread overview]
Message-ID: <5440047C.7020206@citrix.com> (raw)
In-Reply-To: <20141016171206.GA2844@zion.uk.xensource.com>

On 16/10/14 18:12, Wei Liu wrote:
> This document analyses the impact of using balloon compaction
> infrastructure in Xen balloon driver.

Thanks for writing this.   This is a excellent starting point for a
productive design discussion.

> ## Benefit for auto-translated guest
> 
> HVM/PVH/ARM guest can have contiguous guest physical address space
> after balloon pages are compacted, which potentially improves memory
> performance provided guest makes use of huge pages, either via
> Hugetlbfs or Transparent Huge Page (THP).
> 
> Consider memory access pattern of these guests, one access to guest
> physical address involves several accesses to machine memory. The
> total number of memory accesses can be represented as:
> 
>> X = H1 * G1 + H2 * G2 + ... + Hn * Gn + 1
> 
> Hx denotes second stage page table walk levels and Gx denotes guest
> page table walk levels.
> 
> By having contiguous guest physical address, guest can make use of
> huge pages. This can reduce the number of G's in formula.
> 
> Reducing number of H's is another project for hypervisor side
> improvement and should be decoupled from Linux side changes.

Whilst this analysis is fine, I don't think this is the real benefit of
using superpages which is reducing TLB usage and reducing the number of
TLB misses.

With fragmented stage 2 tables I don't think you will see see much
improvement in TLB usage.

> ## HAP table fragmentation is not made worse

This reasoning looks reasonable to me.  But it suggests that the balloon
compaction isn't doing it's job properly.  It seems like it should be
much more proactive in resolving fragmentation.

> ## Beyond Linux balloon compaction infrastructure
> 
> Currently there's no mechanism in Xen to coalesce HAP table
> entries. To coalesce HAP entries we would need to make sure all
> discrete entries belong to one huge page, are in correct order and
> correct state.

I would like to see a more detailed description of the Xen-side
solution.  So we can be sure the Linux half is compatible with it.

Before accepting any series I would also need to see real world
performance improvements, not just theoretical ones.

David

  reply	other threads:[~2014-10-16 17:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-16 17:12 Analysis of using balloon page compaction in Xen balloon driver Wei Liu
2014-10-16 17:46 ` David Vrabel [this message]
2014-10-17  8:20   ` Ian Campbell
2014-10-17 10:07     ` David Vrabel
2014-10-17 12:30 ` Andrew Cooper
2014-10-17 12:44   ` Ian Campbell
2014-10-17 13:27   ` Wei Liu

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=5440047C.7020206@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=ian.campbell@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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.