All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Rafael Aquini <aquini@redhat.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, riel@redhat.com, mst@redhat.com,
	amit.shah@redhat.com, anton@enomsg.org
Subject: Re: [RFC 2/2] virtio_balloon: auto-ballooning support
Date: Fri, 10 May 2013 09:28:19 -0400	[thread overview]
Message-ID: <20130510092819.322798b7@redhat.com> (raw)
In-Reply-To: <20130510092046.17be9bbb@redhat.com>

On Fri, 10 May 2013 09:20:46 -0400
Luiz Capitulino <lcapitulino@redhat.com> wrote:

> On Thu, 9 May 2013 18:15:19 -0300
> Rafael Aquini <aquini@redhat.com> wrote:
> 
> > On Thu, May 09, 2013 at 10:53:49AM -0400, Luiz Capitulino wrote:
> > > Automatic ballooning consists of dynamically adjusting the guest's
> > > balloon according to memory pressure in the host and in the guest.
> > > 
> > > This commit implements the guest side of automatic balloning, which
> > > basically consists of registering a shrinker callback with the kernel,
> > > which will try to deflate the guest's balloon by the amount of pages
> > > being requested. The shrinker callback is only registered if the host
> > > supports the VIRTIO_BALLOON_F_AUTO_BALLOON feature bit.
> > > 
> > > Automatic inflate is performed by the host.
> > > 
> > > Here are some numbers. The test-case is to run 35 VMs (1G of RAM each)
> > > in parallel doing a kernel build. Host has 32GB of RAM and 16GB of swap.
> > > SWAP IN and SWAP OUT correspond to the number of pages swapped in and
> > > swapped out, respectively.
> > > 
> > > Auto-ballooning disabled:
> > > 
> > > RUN  TIME(s)  SWAP IN  SWAP OUT
> > > 
> > > 1    634      930980   1588522
> > > 2    610      627422   1362174
> > > 3    649      1079847  1616367
> > > 4    543      953289   1635379
> > > 5    642      913237   1514000
> > > 
> > > Auto-ballooning enabled:
> > > 
> > > RUN  TIME(s)  SWAP IN  SWAP OUT
> > > 
> > > 1    629      901      12537
> > > 2    624      981      18506
> > > 3    626      573      9085
> > > 4    631      2250     42534
> > > 5    627      1610     20808
> > > 
> > > Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> > > ---
> > 
> > Nice work Luiz! Just allow me a silly question, though. 
> 
> I have 100% more chances of committing sillynesses than you, so please
> go ahead.
> 
> > Since your shrinker
> > doesn't change the balloon target size,
> 
> Which target size are you referring to? The one in the host (member num_pages
> of VirtIOBalloon in QEMU)?
> 
> If it the one in the host, then my understanding is that that member is only
> used to communicate the new balloon target to the guest. The guest driver
> will only read it when told (by the host) to do so, and when it does the
> target value will be correct.
> 
> Am I right?
> 
> > as soon as the shrink round finishes the
> > balloon will re-inflate again, won't it? Doesn't this cause a sort of "balloon
> > thrashing" scenario, if both guest and host are suffering from memory pressure?

Forgot to say that I didn't observe this in my testing. But I'll try harder
as soon as we clarify which target size we're talking about.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Rafael Aquini <aquini@redhat.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, riel@redhat.com, mst@redhat.com,
	amit.shah@redhat.com, anton@enomsg.org
Subject: Re: [RFC 2/2] virtio_balloon: auto-ballooning support
Date: Fri, 10 May 2013 09:28:19 -0400	[thread overview]
Message-ID: <20130510092819.322798b7@redhat.com> (raw)
In-Reply-To: <20130510092046.17be9bbb@redhat.com>

On Fri, 10 May 2013 09:20:46 -0400
Luiz Capitulino <lcapitulino@redhat.com> wrote:

> On Thu, 9 May 2013 18:15:19 -0300
> Rafael Aquini <aquini@redhat.com> wrote:
> 
> > On Thu, May 09, 2013 at 10:53:49AM -0400, Luiz Capitulino wrote:
> > > Automatic ballooning consists of dynamically adjusting the guest's
> > > balloon according to memory pressure in the host and in the guest.
> > > 
> > > This commit implements the guest side of automatic balloning, which
> > > basically consists of registering a shrinker callback with the kernel,
> > > which will try to deflate the guest's balloon by the amount of pages
> > > being requested. The shrinker callback is only registered if the host
> > > supports the VIRTIO_BALLOON_F_AUTO_BALLOON feature bit.
> > > 
> > > Automatic inflate is performed by the host.
> > > 
> > > Here are some numbers. The test-case is to run 35 VMs (1G of RAM each)
> > > in parallel doing a kernel build. Host has 32GB of RAM and 16GB of swap.
> > > SWAP IN and SWAP OUT correspond to the number of pages swapped in and
> > > swapped out, respectively.
> > > 
> > > Auto-ballooning disabled:
> > > 
> > > RUN  TIME(s)  SWAP IN  SWAP OUT
> > > 
> > > 1    634      930980   1588522
> > > 2    610      627422   1362174
> > > 3    649      1079847  1616367
> > > 4    543      953289   1635379
> > > 5    642      913237   1514000
> > > 
> > > Auto-ballooning enabled:
> > > 
> > > RUN  TIME(s)  SWAP IN  SWAP OUT
> > > 
> > > 1    629      901      12537
> > > 2    624      981      18506
> > > 3    626      573      9085
> > > 4    631      2250     42534
> > > 5    627      1610     20808
> > > 
> > > Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> > > ---
> > 
> > Nice work Luiz! Just allow me a silly question, though. 
> 
> I have 100% more chances of committing sillynesses than you, so please
> go ahead.
> 
> > Since your shrinker
> > doesn't change the balloon target size,
> 
> Which target size are you referring to? The one in the host (member num_pages
> of VirtIOBalloon in QEMU)?
> 
> If it the one in the host, then my understanding is that that member is only
> used to communicate the new balloon target to the guest. The guest driver
> will only read it when told (by the host) to do so, and when it does the
> target value will be correct.
> 
> Am I right?
> 
> > as soon as the shrink round finishes the
> > balloon will re-inflate again, won't it? Doesn't this cause a sort of "balloon
> > thrashing" scenario, if both guest and host are suffering from memory pressure?

Forgot to say that I didn't observe this in my testing. But I'll try harder
as soon as we clarify which target size we're talking about.

  reply	other threads:[~2013-05-10 13:28 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-09 14:53 [RFC v2 0/2] virtio_balloon: auto-ballooning support Luiz Capitulino
2013-05-09 14:53 ` Luiz Capitulino
2013-05-09 14:53 ` [RFC 1/2] virtio_balloon: move balloon_lock mutex to callers Luiz Capitulino
2013-05-09 14:53   ` Luiz Capitulino
2013-05-09 21:03   ` Rafael Aquini
2013-05-09 21:03     ` Rafael Aquini
2013-05-10 12:52     ` Luiz Capitulino
2013-05-10 12:52       ` Luiz Capitulino
2013-05-09 14:53 ` [RFC 2/2] virtio_balloon: auto-ballooning support Luiz Capitulino
2013-05-09 14:53   ` Luiz Capitulino
2013-05-09 21:15   ` Rafael Aquini
2013-05-09 21:15     ` Rafael Aquini
2013-05-10 13:20     ` Luiz Capitulino
2013-05-10 13:20       ` Luiz Capitulino
2013-05-10 13:28       ` Luiz Capitulino [this message]
2013-05-10 13:28         ` Luiz Capitulino
2013-05-13 14:34       ` Rafael Aquini
2013-05-13 14:34         ` Rafael Aquini
2013-05-13 18:25         ` Luiz Capitulino
2013-05-13 18:25           ` Luiz Capitulino
2013-05-13 19:02           ` Michael S. Tsirkin
2013-05-13 19:02             ` Michael S. Tsirkin
2013-05-13 20:01             ` Luiz Capitulino
2013-05-13 20:01               ` Luiz Capitulino
2013-05-12 14:30   ` Michael S. Tsirkin
2013-05-12 14:30     ` Michael S. Tsirkin
2013-05-12 16:36     ` Rik van Riel
2013-05-12 16:36       ` Rik van Riel
2013-05-12 18:49       ` Michael S. Tsirkin
2013-05-12 18:49         ` Michael S. Tsirkin
2013-05-13 15:03         ` Luiz Capitulino
2013-05-13 15:03           ` Luiz Capitulino
2013-05-13 15:16           ` Michael S. Tsirkin
2013-05-13 15:16             ` Michael S. Tsirkin
2013-05-13 15:22             ` Rik van Riel
2013-05-13 15:22               ` Rik van Riel
2013-05-13 15:35               ` Michael S. Tsirkin
2013-05-13 15:35                 ` Michael S. Tsirkin
2013-05-13 19:10                 ` Rik van Riel
2013-05-13 19:10                   ` Rik van Riel
2013-05-13 19:21                   ` Michael S. Tsirkin
2013-05-13 19:21                     ` Michael S. Tsirkin
2013-05-16 20:56 ` [RFC v2 0/2] " Sasha Levin
2013-05-16 20:56   ` Sasha Levin
2013-05-16 21:04   ` Luiz Capitulino
2013-05-16 21:04     ` Luiz Capitulino

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=20130510092819.322798b7@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=anton@enomsg.org \
    --cc=aquini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mst@redhat.com \
    --cc=riel@redhat.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.