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 1/2] acpi: remove section mappings on memory hot-remove
Date: Thu, 5 Apr 2012 20:07:01 +0200 [thread overview]
Message-ID: <1333649222-24285-2-git-send-email-vasilis.liaskovitis@profitbricks.com> (raw)
In-Reply-To: <1333649222-24285-1-git-send-email-vasilis.liaskovitis@profitbricks.com>
Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
---
drivers/acpi/acpi_memhotplug.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index d985713..75d33cd 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -29,6 +29,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
+#include <linux/mm.h>
#include <linux/memory_hotplug.h>
#include <linux/slab.h>
#include <acpi/acpi_drivers.h>
@@ -310,7 +311,8 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
{
int result;
struct acpi_memory_info *info, *n;
-
+ int start_pfn, end_pfn;
+ struct zone *zone;
/*
* Ask the VM to offline this memory range.
@@ -321,6 +323,19 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
result = remove_memory(info->start_addr, info->length);
if (result)
return result;
+ /*
+ * Remove section mappings and sysfs entries for the
+ * section of the memory we are removing.
+ */
+
+ start_pfn = PFN_DOWN(info->start_addr);
+ end_pfn = start_pfn + PFN_DOWN(info->length);
+ zone = page_zone(pfn_to_page(start_pfn));
+ result = __remove_pages(zone, start_pfn,
+ end_pfn - start_pfn);
+ if (result)
+ return result;
+
}
kfree(info);
}
--
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>
next 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 ` Vasilis Liaskovitis [this message]
2012-04-05 18:07 ` [PATCH 2/2] mm: consistently register / release memory resource Vasilis Liaskovitis
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-2-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