Skip to contentSkip to conversation

mm: migrate: add isolate_movable_page() stub implementation

PATCH In review Arnd Bergmann 2 participants 2 messages Jan 25, 2017 – Jan 26, 2017 MM migration

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: migrate: add isolate_movable_page() stub implementation

Without CONFIG_MIGRATION, we get a build failure when trying to call isolate_movable_page():

mm/memory-failure.c: In function '__soft_offline_page':
mm/memory-failure.c:1656:10: error: implicit declaration of function 'isolate_movable_page';did you mean 'isolate_huge_page'? [-Werror=implicit-function-declaration]

This adds one more static inline helper function in the header declaring it. This returns false to indicate that the page was not isolated.

Fixes mmotm ("HWPOISON: soft offlining for non-lru movable pages")
Fixes bda807d44454 ("mm: migrate: support non-lru movable page migration")
---
 include/linux/migrate.h | 3 +++
 1 file changed, 3 insertions(+)
include/linux/migrate.h +3 -0
index ae8d475a9385..09dd6e924106 100644
@@ -57,6 +57,9 @@ static inline int migrate_pages(struct list_head *l, new_page_t new,
 		int reason)
 	{ return -ENOSYS; }
 
+static inline bool isolate_movable_page(struct page *page, isolate_mode_t mode)
+	{ return false; }
+
 static inline int migrate_prep(void) { return -ENOSYS; }
 static inline int migrate_prep_local(void) { return -ENOSYS; }
 
Signature · 1 line
2.9.0
#1 lore raw

JFYI, Yisheng Xie has already posted a new version of the patchset [1] and I assume Andrew will drop the current one.

[1] http://lkml.kernel.org/r/[email protected]

Quoted 33 lines · Arnd Bergmann

Without CONFIG_MIGRATION, we get a build failure when trying to call isolate_movable_page():

mm/memory-failure.c: In function '__soft_offline_page':
mm/memory-failure.c:1656:10: error: implicit declaration of function 'isolate_movable_page';did you mean 'isolate_huge_page'? [-Werror=implicit-function-declaration]

This adds one more static inline helper function in the header declaring it. This returns false to indicate that the page was not isolated.

Fixes mmotm ("HWPOISON: soft offlining for non-lru movable pages")
Fixes bda807d44454 ("mm: migrate: support non-lru movable page migration")
---
 include/linux/migrate.h | 3 +++
 1 file changed, 3 insertions(+)
include/linux/migrate.h +3 -0
index ae8d475a9385..09dd6e924106 100644
@@ -57,6 +57,9 @@ static inline int migrate_pages(struct list_head *l, new_page_t new,
 		int reason)
 	{ return -ENOSYS; }
 
+static inline bool isolate_movable_page(struct page *page, isolate_mode_t mode)
+	{ return false; }
+
 static inline int migrate_prep(void) { return -ENOSYS; }
 static inline int migrate_prep_local(void) { return -ENOSYS; }
 
Signature · 1 line
2.9.0
Signature · 2 lines
Michal Hocko
SUSE Labs