From: David Vrabel Date: Wed, 28 Sep 2011 16:46:33 +0000 (+0100) Subject: xen/balloon: simplify test for the end of usable RAM X-Git-Tag: v2.6.39-400.9.0~854^2~2^2~3 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4c9097c705d215f532ea45edebf39b0cdfb788e1;p=users%2Fjedix%2Flinux-maple.git xen/balloon: simplify test for the end of usable RAM When initializing the balloon only max_pfn needs to be checked (max_pfn will always be <= e820_end_of_ram_pfn()) and improve the confusing comment. Signed-off-by: David Vrabel Signed-off-by: Konrad Rzeszutek Wilk --- diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 13c2a84d95b5..c374c58a2ab6 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -451,16 +451,16 @@ static int __init balloon_init(void) balloon_stats.max_retry_count = RETRY_UNLIMITED; /* - * Initialise the balloon with excess memory space. We need - * to make sure we don't add memory which doesn't exist or - * logically exist. The E820 map can be trimmed to be smaller - * than the amount of physical memory due to the mem= command - * line parameter. And if this is a 32-bit non-HIGHMEM kernel - * on a system with memory which requires highmem to access, - * don't try to use it. + * Initialize the balloon with pages from the extra memory + * region (see arch/x86/xen/setup.c). + * + * If the amount of usable memory has been limited (e.g., with + * the 'mem' command line parameter), don't add pages beyond + * this limit. */ - extra_pfn_end = min(min(max_pfn, e820_end_of_ram_pfn()), - (unsigned long)PFN_DOWN(xen_extra_mem_start + xen_extra_mem_size)); + extra_pfn_end = min(max_pfn, + (unsigned long)PFN_DOWN(xen_extra_mem_start + + xen_extra_mem_size)); for (pfn = PFN_UP(xen_extra_mem_start); pfn < extra_pfn_end; pfn++) {