linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2]: LMB small bug fix and debugging tidy up.
@ 2008-05-13  0:41 David Miller
  2008-05-13  1:13 ` [rfc patch] memory_hotplug: Check for walk_memory_resource() failure in online_pages() Geoff Levand
  0 siblings, 1 reply; 2+ messages in thread
From: David Miller @ 2008-05-13  0:41 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: mikpe, paulus, linux-kernel


While diagnosing Mikael's bug where half of his RAM disappeared
in 2.6.26-rc2 I found one bug (which I don't think fixes his
problem, but waiting for an updated set of debugging logs from
him) and an improvement to the debugging provided by the current
LMB code.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [rfc patch] memory_hotplug: Check for walk_memory_resource() failure in online_pages()
  2008-05-13  0:41 [PATCH 0/2]: LMB small bug fix and debugging tidy up David Miller
@ 2008-05-13  1:13 ` Geoff Levand
  0 siblings, 0 replies; 2+ messages in thread
From: Geoff Levand @ 2008-05-13  1:13 UTC (permalink / raw)
  To: akpm; +Cc: Yasunori Goto, mikpe, Badari Pulavarty, linux-kernel,
	linuxppc-dev

Add a check to online_pages() to test for failure of
walk_memory_resource().  This fixes a condition where a failure
of walk_memory_resource() can lead to online_pages() returning
success without the requested pages being onlined.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---

I'm not entirely sure this is the proper way to handle this
condition.  Comments welcome.

 mm/memory_hotplug.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -408,8 +408,15 @@ int online_pages(unsigned long pfn, unsi
 	if (!populated_zone(zone))
 		need_zonelists_rebuild = 1;
 
-	walk_memory_resource(pfn, nr_pages, &onlined_pages,
+	ret = walk_memory_resource(pfn, nr_pages, &onlined_pages,
 		online_pages_range);
+	if (ret) {
+		printk(KERN_DEBUG "online_pages %lx at %lx failed\n",
+			nr_pages, pfn);
+		memory_notify(MEM_CANCEL_ONLINE, &arg);
+		return ret;
+	}
+
 	zone->present_pages += onlined_pages;
 	zone->zone_pgdat->node_present_pages += onlined_pages;
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-13  1:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-13  0:41 [PATCH 0/2]: LMB small bug fix and debugging tidy up David Miller
2008-05-13  1:13 ` [rfc patch] memory_hotplug: Check for walk_memory_resource() failure in online_pages() Geoff Levand

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).