Automatic ballooning Red Hat Presenter Luiz Capitulino - - PowerPoint PPT Presentation

automatic ballooning
SMART_READER_LITE
LIVE PREVIEW

Automatic ballooning Red Hat Presenter Luiz Capitulino - - PowerPoint PPT Presentation

Name of Presentation Automatic ballooning Red Hat Presenter Luiz Capitulino lcapitulino@redhat.com October 22 nd , 2013 Luiz Capitulino 1 Agenda The balloon driver Making it automatic Testing & some numbers Luiz


slide-1
SLIDE 1

1 Luiz Capitulino

Name of Presentation Red Hat Presenter

Automatic ballooning

Luiz Capitulino

lcapitulino@redhat.com

October 22nd, 2013

slide-2
SLIDE 2

2 Luiz Capitulino

Agenda

The balloon driver

Making it automatic

Testing & some numbers

slide-3
SLIDE 3

3 Luiz Capitulino

The balloon driver

slide-4
SLIDE 4

4 Luiz Capitulino

The balloon driver

Implements two fundamental operations

  • Inflate: memory is taken from the guest and given to the host
  • Deflate: memory is taken from the host back to the guest

Also supports statistics reporting and other features

Available for Linux and Windows guests

slide-5
SLIDE 5

5 Luiz Capitulino

Inflate example

slide-6
SLIDE 6

6 Luiz Capitulino

Deflate example

slide-7
SLIDE 7

7 Luiz Capitulino

Balloon's primary advantage

slide-8
SLIDE 8

8 Luiz Capitulino

Balloon's primary disadvantage

slide-9
SLIDE 9

9 Luiz Capitulino

We do have to make it automatic

Guests automatically shrink on host pressure

Guests automatically grow when they face pressure themselves

Guests are automatically managed on memory over- commited Hosts

slide-10
SLIDE 10

10 Luiz Capitulino

Making it automatic

(Based on a design by Rik van Riel, help from Rafael Aquini)

slide-11
SLIDE 11

11 Luiz Capitulino

vmpressure events (auto-inflate)

Added to kernel 3.10 by Anton Vorontsov

Part of memory controller cgroup

Defines three pressure levels

  • LOW: the kernel is

reclaiming memory for new allocations

  • MEDIUM: some swapping

may be going on

  • CRITICAL: the system is

thrashing, OOM killer may be on its way to trigger

User-space is notified via eventfds

slide-12
SLIDE 12

12 Luiz Capitulino

vmpressure usage for auto-inflate

QEMU registers eventfds for low, medium and critical

QEMU uses pre-defined values to perform auto-inflate

  • Low: 256 (1MB)
  • Medium: 512 (2MB)
  • Critical: 1024 (4MB)

These values can be run-time tunables

slide-13
SLIDE 13

13 Luiz Capitulino

Auto-inflate problems/solutions

Pre-defined values don't take host nor guest need into consideration

  • Solution: the host tells the guest its facing pressure and the guest releases

pages accordingly

QEMU can get as many as 20 events when host is under pressure

  • Solution: event throttling in QEMU (1 per sec)

All event fds are woken up on CRITICAL level

  • Solution: demultiplex events in QEMU
slide-14
SLIDE 14

14 Luiz Capitulino

shrink callback (auto-deflate)

Drivers or subsystems can register a function to be called when the kernel is facing memory pressure

The guest virtio-balloon driver implements such a function which performs auto-deflate (ie. memory is reclaimed for the guest)

slide-15
SLIDE 15

15 Luiz Capitulino

Auto-deflate problems/solutions

The shrinker API asks for (only!) 128 pages per call

Auto-deflate can be delayed due to auto-inflate taking too long

slide-16
SLIDE 16

16 Luiz Capitulino

A few words on the current status

A prototype exists for almost a year

  • Still pretty experimental

Two RFC versions posted upstream

  • Need more feedback!
slide-17
SLIDE 17

17 Luiz Capitulino

Testing

slide-18
SLIDE 18

18 Luiz Capitulino

Take it with a grain of salt

Very hard to come up with a good test-case

Smallest change in parameters can change the results

Several scenarios to be tested

slide-19
SLIDE 19

19 Luiz Capitulino

A very simple test-case

slide-20
SLIDE 20

20 Luiz Capitulino

Test results: 10 runs average

Vanilla auto-ballon Difference %

Total run time (sec) 441 441 0% Pages swapped in (host) 46346 41898

  • 9.60%

Pages swapped out (host) 209710 196080

  • 6.50%

Specjbb throughput – VMs (bops) 57378.96 58086.61 +1.23%

slide-21
SLIDE 21

21 Luiz Capitulino

That's all folks!

Luiz Capitulino <lcapitulino@redhat.com>

http://www.linux-kvm.org/Projects/auto-ballooning