aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/balloon_compaction.h
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2013-11-07 10:34:46 -0600
committerRob Herring <rob.herring@calxeda.com>2013-11-07 10:34:46 -0600
commitb5480950c6cbb7b07ab1c1a5af0dc661a1cb6f24 (patch)
treeb5fcb00387a838beb2bcf2f8ed2fd3d6d460c8ae /include/linux/balloon_compaction.h
parentMIPS: Netlogic: replace early_init_devtree() call (diff)
parentof/irq: Fix potential buffer overflow (diff)
downloadlinux-dev-b5480950c6cbb7b07ab1c1a5af0dc661a1cb6f24.tar.xz
linux-dev-b5480950c6cbb7b07ab1c1a5af0dc661a1cb6f24.zip
Merge remote-tracking branch 'grant/devicetree/next' into for-next
Diffstat (limited to 'include/linux/balloon_compaction.h')
-rw-r--r--include/linux/balloon_compaction.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/balloon_compaction.h b/include/linux/balloon_compaction.h
index f7f1d7169b11..089743ade734 100644
--- a/include/linux/balloon_compaction.h
+++ b/include/linux/balloon_compaction.h
@@ -159,6 +159,26 @@ static inline bool balloon_page_movable(struct page *page)
}
/*
+ * isolated_balloon_page - identify an isolated balloon page on private
+ * compaction/migration page lists.
+ *
+ * After a compaction thread isolates a balloon page for migration, it raises
+ * the page refcount to prevent concurrent compaction threads from re-isolating
+ * the same page. For that reason putback_movable_pages(), or other routines
+ * that need to identify isolated balloon pages on private pagelists, cannot
+ * rely on balloon_page_movable() to accomplish the task.
+ */
+static inline bool isolated_balloon_page(struct page *page)
+{
+ /* Already isolated balloon pages, by default, have a raised refcount */
+ if (page_flags_cleared(page) && !page_mapped(page) &&
+ page_count(page) >= 2)
+ return __is_movable_balloon_page(page);
+
+ return false;
+}
+
+/*
* balloon_page_insert - insert a page into the balloon's page list and make
* the page->mapping assignment accordingly.
* @page : page to be assigned as a 'balloon page'
@@ -243,6 +263,11 @@ static inline bool balloon_page_movable(struct page *page)
return false;
}
+static inline bool isolated_balloon_page(struct page *page)
+{
+ return false;
+}
+
static inline bool balloon_page_isolate(struct page *page)
{
return false;