linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Yasunori Goto <y-goto@jp.fujitsu.com>,
	Dave Hansen <dave@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
	Christoph Lameter <clameter@sgi.com>
Subject: [PATCH 6 of 6] xen-balloon: define a section_ops
Date: Thu, 03 Apr 2008 17:05:46 -0700	[thread overview]
Message-ID: <e926df8cca107c8c77aa.1207267546@localhost> (raw)
In-Reply-To: <patchbomb.1207267540@localhost>

Define a xen_balloon_section_ops to control how xen balloon pages are onlined.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
---
 drivers/xen/balloon.c |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -139,6 +139,21 @@
 	}
 }
 
+/* Only online a page if there's some memory backing it */
+static bool xen_online_page(struct page *page)
+{
+    unsigned long pfn = page_to_pfn(page);
+
+    if (get_phys_to_machine(pfn) == INVALID_P2M_ENTRY)
+	return false;
+
+    return online_page(page);
+}
+
+static const struct section_ops xen_balloon_section_ops = {
+    .online_page = xen_online_page
+};
+
 /* hotplug some memory we can add pages to */
 static void balloon_expand(unsigned pages)
 {
@@ -165,7 +180,7 @@
 	start_pfn = res->start >> PAGE_SHIFT;
 	end_pfn = (res->end + 1) >> PAGE_SHIFT;
 
-	ret = add_memory_resource(0, res, &default_section_ops);
+	ret = add_memory_resource(0, res, &xen_balloon_section_ops);
 	if (ret)
 		goto release_res;
 



      parent reply	other threads:[~2008-04-04  0:18 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-04  0:05 [PATCH 0 of 6] [RFC] another attempt at making hotplug memory and xen play together Jeremy Fitzhardinge
2008-04-04  0:05 ` [PATCH 1 of 6] hotplug-memory: refactor online_pages to separate zone growth from page onlining Jeremy Fitzhardinge
2008-04-04  1:06   ` Dave Hansen
2008-04-04  1:20     ` Jeremy Fitzhardinge
2008-04-04  1:33       ` Dave Hansen
2008-04-04  1:09   ` Dave Hansen
2008-04-04  1:32     ` Jeremy Fitzhardinge
2008-04-04  1:41       ` Dave Hansen
2008-04-04  1:56   ` Yasunori Goto
2008-04-04  5:34     ` Jeremy Fitzhardinge
2008-04-04  0:05 ` [PATCH 2 of 6] xen: make phys_to_machine structure dynamic Jeremy Fitzhardinge
2008-04-04  0:05 ` [PATCH 3 of 6] xen-balloon: use memory hot-add to expand the domain's memory Jeremy Fitzhardinge
2008-04-04  0:05 ` [PATCH 4 of 6] hotplug-memory: use common online_page Jeremy Fitzhardinge
2008-04-04  0:47   ` Dave Hansen
2008-04-04  0:56     ` Jeremy Fitzhardinge
2008-04-04  1:00       ` Dave Hansen
2008-04-04  1:11         ` Jeremy Fitzhardinge
2008-04-04  1:22           ` Dave Hansen
2008-04-04  0:05 ` [PATCH 5 of 6] hotplug-memory: add section_ops Jeremy Fitzhardinge
2008-04-04  0:51   ` Dave Hansen
2008-04-04  1:12     ` Jeremy Fitzhardinge
2008-04-04  1:52       ` Dave Hansen
2008-04-04  5:32         ` Jeremy Fitzhardinge
2008-04-04 14:22           ` Dave Hansen
2008-04-04 18:21             ` Jeremy Fitzhardinge
2008-04-04 19:28               ` Christoph Lameter
2008-04-04 20:38                 ` Jeremy Fitzhardinge
2008-04-04  1:47     ` KAMEZAWA Hiroyuki
2008-04-04  5:35       ` Jeremy Fitzhardinge
2008-04-04  0:05 ` Jeremy Fitzhardinge [this message]

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=e926df8cca107c8c77aa.1207267546@localhost \
    --to=jeremy@goop.org \
    --cc=clameter@sgi.com \
    --cc=dave@linux.vnet.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=y-goto@jp.fujitsu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).