From: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
To: linux-mm@kvack.org, linux-acpi@vger.kernel.org
Cc: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
Subject: [PATCH 2/2] mm: consistently register / release memory resource
Date: Thu, 5 Apr 2012 20:07:02 +0200 [thread overview]
Message-ID: <1333649222-24285-3-git-send-email-vasilis.liaskovitis@profitbricks.com> (raw)
In-Reply-To: <1333649222-24285-1-git-send-email-vasilis.liaskovitis@profitbricks.com>
add_memory() registers hotplugged memory resources by calling
register_memory_resource() for the whole memory range requested.
However, __remove_pages() releases memory resources by calling
release_memory_region on a per section basis. This discrepancy
can break memory hotplug operations when using memory devices
that span multiple sections. Specifically hot-readd
(hot-add/hot-remove/hot-add sequence) will not work. Fix by releasing
the memory resource as a whole (another option would be to register
and release always on a per section basis).
Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
---
mm/memory_hotplug.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 6629faf..8ab6b63 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -362,12 +362,12 @@ int __remove_pages(struct zone *zone, unsigned long phys_start_pfn,
sections_to_remove = nr_pages / PAGES_PER_SECTION;
for (i = 0; i < sections_to_remove; i++) {
unsigned long pfn = phys_start_pfn + i*PAGES_PER_SECTION;
- release_mem_region(pfn << PAGE_SHIFT,
- PAGES_PER_SECTION << PAGE_SHIFT);
ret = __remove_section(zone, __pfn_to_section(pfn));
if (ret)
break;
}
+ release_mem_region(phys_start_pfn << PAGE_SHIFT,
+ nr_pages << PAGE_SHIFT);
return ret;
}
EXPORT_SYMBOL_GPL(__remove_pages);
--
1.7.9
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2012-04-05 18:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-05 18:07 [PATCH 0/2] mm/acpi hotplug fixes for hot-remove Vasilis Liaskovitis
2012-04-05 18:07 ` [PATCH 1/2] acpi: remove section mappings on memory hot-remove Vasilis Liaskovitis
2012-04-05 18:07 ` Vasilis Liaskovitis [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=1333649222-24285-3-git-send-email-vasilis.liaskovitis@profitbricks.com \
--to=vasilis.liaskovitis@profitbricks.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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