From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: balloon question Date: Fri, 09 Jun 2006 11:52:38 +0200 Message-ID: <44896106.76E4.0078.0@novell.com> References: <4488479F.76E4.0078.0@novell.com> <15e85c6aa3f95ddc8a8d4d121ca056cc@cl.cam.ac.uk> <448938BA.76E4.0078.0@novell.com> <88c8090558680a08b523cf86cfb0c497@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part1732D7F6.1__=" Return-path: In-Reply-To: <88c8090558680a08b523cf86cfb0c497@cl.cam.ac.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part1732D7F6.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline >But I think it's prefereable to take the following loop from >i386/mm/init-xen.c and put it in x86/64's mem_init() somewhere: > for (i = ...->nr_pages; i < max_pfn; i++) { > ClearPageReserved(...); > set_page_count(..., 1); > } Did you deliberately leave out the increment of totalram_pages that is in i386's respective loop? I have to admit that I can't see why i386 is doing that, but for symmetry I added it to x86-64's loop, too (balloon_init() re-writes the variable anyway). >That'll allow any architecture to reserve stuff beyond ->nr_pages >without breaking the balloon driver. Could you try adding the above >code and see how it works out? Works out as expected (i.e. balloon now contains all the extra pages). Patch attached. Jan --=__Part1732D7F6.1__= Content-Type: text/plain; name="xenlinux-x86_64-unreserve-extra-pages.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xenlinux-x86_64-unreserve-extra-pages.patch" Index: head-2006-06-07/arch/x86_64/mm/init-xen.c =================================================================== --- head-2006-06-07.orig/arch/x86_64/mm/init-xen.c 2006-06-09 10:16:34.000000000 +0200 +++ head-2006-06-07/arch/x86_64/mm/init-xen.c 2006-06-09 10:25:03.000000000 +0200 @@ -882,6 +882,7 @@ static struct kcore_list kcore_mem, kcor void __init mem_init(void) { long codesize, reservedpages, datasize, initsize; + unsigned long pfn; contiguous_bitmap = alloc_bootmem_low_pages( (end_pfn + 2*BITS_PER_LONG) >> 3); @@ -910,6 +911,12 @@ void __init mem_init(void) #else totalram_pages = free_all_bootmem(); #endif + /* XEN: init and count pages outside initial allocation. */ + for (pfn = xen_start_info->nr_pages; pfn < max_pfn; pfn++) { + ClearPageReserved(&mem_map[pfn]); + set_page_count(&mem_map[pfn], 1); + totalram_pages++; + } reservedpages = end_pfn - totalram_pages - e820_hole_size(0, end_pfn); after_bootmem = 1; --=__Part1732D7F6.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part1732D7F6.1__=--