aboutsummaryrefslogtreecommitdiffstats
path: root/mm/ksm.c
diff options
context:
space:
mode:
authorLuden <luden@ghostmail.com>2016-04-07 13:20:23 +0200
committerZiyan <jaraidaniel@gmail.com>2016-05-01 23:35:47 +0200
commit980a74e2c46a5f8b8ae8ef4e73dbcc4bf26443b9 (patch)
treec6b2cec1fc791963579ac1becb119d2139e478c7 /mm/ksm.c
parenta62e05e883fbbb201f6f89453849452c32d79429 (diff)
downloadkernel_samsung_tuna-980a74e2c46a5f8b8ae8ef4e73dbcc4bf26443b9.zip
kernel_samsung_tuna-980a74e2c46a5f8b8ae8ef4e73dbcc4bf26443b9.tar.gz
kernel_samsung_tuna-980a74e2c46a5f8b8ae8ef4e73dbcc4bf26443b9.tar.bz2
CMA fixes for kernel 3.0
Diffstat (limited to 'mm/ksm.c')
-rw-r--r--mm/ksm.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/mm/ksm.c b/mm/ksm.c
index b126a7f..d623e5b 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -1786,9 +1786,7 @@ void ksm_migrate_page(struct page *newpage, struct page *oldpage)
stable_node->kpfn = page_to_pfn(newpage);
}
}
-#endif /* CONFIG_MIGRATION */
-#ifdef CONFIG_MEMORY_HOTREMOVE
static struct stable_node *ksm_check_stable_tree(unsigned long start_pfn,
unsigned long end_pfn)
{
@@ -1805,6 +1803,27 @@ static struct stable_node *ksm_check_stable_tree(unsigned long start_pfn,
return NULL;
}
+void ksm_start_migration(void)
+{
+ mutex_lock(&ksm_thread_mutex);
+}
+
+void ksm_finalize_migration(unsigned long start_pfn, unsigned long nr_pages)
+{
+ struct stable_node *stable_node;
+ while ((stable_node = ksm_check_stable_tree(start_pfn,
+ start_pfn + nr_pages)) != NULL)
+ remove_node_from_stable_tree(stable_node);
+ mutex_unlock(&ksm_thread_mutex);
+}
+
+void ksm_abort_migration(void)
+{
+ mutex_unlock(&ksm_thread_mutex);
+}
+#endif /* CONFIG_MIGRATION */
+
+#ifdef CONFIG_MEMORY_HOTREMOVE
static int ksm_memory_callback(struct notifier_block *self,
unsigned long action, void *arg)
{