aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hv
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@microsoft.com>2015-01-10 02:54:29 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-25 12:17:57 -0500
commit79208c57da5311860f165b613c89b3f647e357cd (patch)
treea870ed90185525e2e3c41dcde7abda0e6de1b316 /drivers/hv
parentc1136da62170465920eea1ae9ba9ce2234091f77 (diff)
Drivers: hv: hv_balloon: Make adjustments in computing the floor
Make adjustments in computing the balloon floor. The current computation of the balloon floor was not appropriate for virtual machines with more than 10 GB of assigned memory - we would get into situations where the host would agressively balloon down the guest and leave the guest in an unusable state. This patch fixes the issue by raising the floor. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r--drivers/hv/hv_balloon.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index b958ded8ac7e..9cbbb831778a 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -928,9 +928,8 @@ static unsigned long compute_balloon_floor(void)
928 * 128 72 (1/2) 928 * 128 72 (1/2)
929 * 512 168 (1/4) 929 * 512 168 (1/4)
930 * 2048 360 (1/8) 930 * 2048 360 (1/8)
931 * 8192 552 (1/32) 931 * 8192 768 (1/16)
932 * 32768 1320 932 * 32768 1536 (1/32)
933 * 131072 4392
934 */ 933 */
935 if (totalram_pages < MB2PAGES(128)) 934 if (totalram_pages < MB2PAGES(128))
936 min_pages = MB2PAGES(8) + (totalram_pages >> 1); 935 min_pages = MB2PAGES(8) + (totalram_pages >> 1);
@@ -938,8 +937,10 @@ static unsigned long compute_balloon_floor(void)
938 min_pages = MB2PAGES(40) + (totalram_pages >> 2); 937 min_pages = MB2PAGES(40) + (totalram_pages >> 2);
939 else if (totalram_pages < MB2PAGES(2048)) 938 else if (totalram_pages < MB2PAGES(2048))
940 min_pages = MB2PAGES(104) + (totalram_pages >> 3); 939 min_pages = MB2PAGES(104) + (totalram_pages >> 3);
940 else if (totalram_pages < MB2PAGES(8192))
941 min_pages = MB2PAGES(256) + (totalram_pages >> 4);
941 else 942 else
942 min_pages = MB2PAGES(296) + (totalram_pages >> 5); 943 min_pages = MB2PAGES(512) + (totalram_pages >> 5);
943#undef MB2PAGES 944#undef MB2PAGES
944 return min_pages; 945 return min_pages;
945} 946}