All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <jbeulich@novell.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com
Subject: Re: balloon question
Date: Fri, 09 Jun 2006 11:52:38 +0200	[thread overview]
Message-ID: <44896106.76E4.0078.0@novell.com> (raw)
In-Reply-To: <88c8090558680a08b523cf86cfb0c497@cl.cam.ac.uk>

[-- Attachment #1: Type: text/plain, Size: 761 bytes --]

>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

[-- Attachment #2: xenlinux-x86_64-unreserve-extra-pages.patch --]
[-- Type: text/plain, Size: 960 bytes --]

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;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  reply	other threads:[~2006-06-09  9:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-08 13:51 balloon question Jan Beulich
2006-06-08 16:25 ` Keir Fraser
2006-06-09  7:00   ` Jan Beulich
2006-06-09  7:05     ` Keir Fraser
2006-06-09  9:52       ` Jan Beulich [this message]
2006-06-09 10:35         ` Keir Fraser
  -- strict thread matches above, loose matches on Subject: below --
2016-04-28  6:58 Zhang, Chunyu
2016-04-28  9:07 ` George Dunlap
2016-04-28 10:10   ` Zhang, Chunyu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44896106.76E4.0078.0@novell.com \
    --to=jbeulich@novell.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.