Adam Litke has uploaded a new change for review. Change subject: policy: Fix balloon policy syntax and semantics ......................................................................
policy: Fix balloon policy syntax and semantics This patch fixes two issues in the current balloon policy: 1) In shrink_guest, guest_free_percent should be min_guest_free_percent. This was causing a runtime error for users. 2) When calculating balloon_min, we want to choose whichever number is higher between guest.balloon_min and the calculated value. Otherwise, guest.balloon_min cannot act as a floor value as it is intended to. Change-Id: I8fba77bb5c42b29ab479752e335cbc11ed0a298b Signed-off-by: Adam Litke <a...@us.ibm.com> --- M doc/balloon.rules 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.ovirt.org:29418/mom refs/changes/16/19416/1 diff --git a/doc/balloon.rules b/doc/balloon.rules index 42990a7..52570c3 100644 --- a/doc/balloon.rules +++ b/doc/balloon.rules @@ -46,7 +46,7 @@ # Given current conditions, determine the ideal guest memory size (defvar guest_used_mem (- (guest.StatAvg "balloon_cur") (guest.StatAvg "mem_unused"))) - (defvar balloon_min (min guest.balloon_min (+ guest_used_mem + (defvar balloon_min (max guest.balloon_min (+ guest_used_mem (* guest_free_percent guest.balloon_cur)))) # But do not change it too fast (defvar balloon_size (* guest.balloon_cur @@ -55,7 +55,7 @@ (set balloon_size balloon_min) 0) # Set the new target for the BalloonController. Only set it if the - # value makes sense and is a large enough change to be worth it. + # value makes sense and is a large enough change to be worth it. (if (and (<= balloon_size guest.balloon_cur) (change_big_enough guest balloon_size)) (guest.Control "balloon_target" balloon_size) @@ -69,14 +69,14 @@ # Minimally, increase so the guest has its desired free memory (defvar guest_used_mem (- (guest.StatAvg "balloon_cur") (guest.StatAvg "mem_unused"))) - (defvar balloon_min (min guest.balloon_min (+ guest_used_mem - (* guest_free_percent guest.balloon_cur)))) + (defvar balloon_min (max guest.balloon_min (+ guest_used_mem + (* min_guest_free_percent guest.balloon_cur)))) # Otherwise, increase according to the max balloon change (defvar balloon_size (* guest.balloon_cur (+ 1 max_balloon_change_percent))) # Determine the new target for the BalloonController. Only set - # if the value is a large enough for the change to be worth it. + # if the value is a large enough for the change to be worth it. (if (> balloon_size guest.balloon_max) (set balloon_size guest.balloon_max) 0) (if (< balloon_size balloon_min) -- To view, visit http://gerrit.ovirt.org/19416 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8fba77bb5c42b29ab479752e335cbc11ed0a298b Gerrit-PatchSet: 1 Gerrit-Project: mom Gerrit-Branch: master Gerrit-Owner: Adam Litke <a...@us.ibm.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches