automatic ballooning
play

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


  1. Name of Presentation Automatic ballooning Red Hat Presenter Luiz Capitulino lcapitulino@redhat.com October 22 nd , 2013 Luiz Capitulino 1

  2. Agenda The balloon driver  Making it automatic  Testing & some numbers  Luiz Capitulino 2

  3. The balloon driver Luiz Capitulino 3

  4. 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  Luiz Capitulino 4

  5. Inflate example Luiz Capitulino 5

  6. Deflate example Luiz Capitulino 6

  7. Balloon's primary advantage Luiz Capitulino 7

  8. Balloon's primary disadvantage Luiz Capitulino 8

  9. 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 Luiz Capitulino 9

  10. Making it automatic (Based on a design by Rik van Riel, help from Rafael Aquini) Luiz Capitulino 10

  11. 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 Luiz Capitulino 11

  12. 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  Luiz Capitulino 12

  13. 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 ● Luiz Capitulino 13

  14. 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) Luiz Capitulino 14

  15. 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  Luiz Capitulino 15

  16. 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! ● Luiz Capitulino 16

  17. Testing Luiz Capitulino 17

  18. 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  Luiz Capitulino 18

  19. A very simple test-case Luiz Capitulino 19

  20. Test results: 10 runs average Vanilla auto-ballon Difference % Total run time (sec) 441 441 0% Pages swapped in 46346 41898 -9.60% (host) Pages swapped out 209710 196080 -6.50% (host) Specjbb throughput 57378.96 58086.61 +1.23% – VMs (bops) Luiz Capitulino 20

  21. That's all folks! Luiz Capitulino <lcapitulino@redhat.com> http://www.linux-kvm.org/Projects/auto-ballooning Luiz Capitulino 21

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend