Commit b1cbf9b1 authored by David Vrabel's avatar David Vrabel Committed by Konrad Rzeszutek Wilk

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: default avatarDavid Vrabel <david.vrabel@citrix.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent aa24411b
...@@ -586,16 +586,16 @@ static int __init balloon_init(void) ...@@ -586,16 +586,16 @@ static int __init balloon_init(void)
#endif #endif
/* /*
* Initialise the balloon with excess memory space. We need * Initialize the balloon with pages from the extra memory
* to make sure we don't add memory which doesn't exist or * region (see arch/x86/xen/setup.c).
* logically exist. The E820 map can be trimmed to be smaller *
* than the amount of physical memory due to the mem= command * If the amount of usable memory has been limited (e.g., with
* line parameter. And if this is a 32-bit non-HIGHMEM kernel * the 'mem' command line parameter), don't add pages beyond
* on a system with memory which requires highmem to access, * this limit.
* don't try to use it.
*/ */
extra_pfn_end = min(min(max_pfn, e820_end_of_ram_pfn()), extra_pfn_end = min(max_pfn,
(unsigned long)PFN_DOWN(xen_extra_mem_start + xen_extra_mem_size)); (unsigned long)PFN_DOWN(xen_extra_mem_start
+ xen_extra_mem_size));
for (pfn = PFN_UP(xen_extra_mem_start); for (pfn = PFN_UP(xen_extra_mem_start);
pfn < extra_pfn_end; pfn < extra_pfn_end;
pfn++) { pfn++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment