[PATCH 10/11] mm: remove offlining arg to migrate_pages

2013-01-25 Thread Hugh Dickins
No functional change, but the only purpose of the offlining argument
to migrate_pages() etc, was to ensure that __unmap_and_move() could
migrate a KSM page for memory hotremove (which took ksm_thread_mutex)
but not for other callers.  Now all cases are safe, remove the arg.

Signed-off-by: Hugh Dickins 
---
 include/linux/migrate.h |   14 ++
 mm/compaction.c |2 +-
 mm/memory-failure.c |7 +++
 mm/memory_hotplug.c |3 +--
 mm/mempolicy.c  |8 +++-
 mm/migrate.c|   35 +--
 mm/page_alloc.c |6 ++
 7 files changed, 29 insertions(+), 46 deletions(-)

--- mmotm.orig/include/linux/migrate.h  2013-01-24 12:28:38.740127550 -0800
+++ mmotm/include/linux/migrate.h   2013-01-25 14:38:51.468208776 -0800
@@ -40,11 +40,9 @@ extern void putback_movable_pages(struct
 extern int migrate_page(struct address_space *,
struct page *, struct page *, enum migrate_mode);
 extern int migrate_pages(struct list_head *l, new_page_t x,
-   unsigned long private, bool offlining,
-   enum migrate_mode mode, int reason);
+   unsigned long private, enum migrate_mode mode, int reason);
 extern int migrate_huge_page(struct page *, new_page_t x,
-   unsigned long private, bool offlining,
-   enum migrate_mode mode);
+   unsigned long private, enum migrate_mode mode);
 
 extern int fail_migrate_page(struct address_space *,
struct page *, struct page *);
@@ -62,11 +60,11 @@ extern int migrate_huge_page_move_mappin
 static inline void putback_lru_pages(struct list_head *l) {}
 static inline void putback_movable_pages(struct list_head *l) {}
 static inline int migrate_pages(struct list_head *l, new_page_t x,
-   unsigned long private, bool offlining,
-   enum migrate_mode mode, int reason) { return -ENOSYS; }
+   unsigned long private, enum migrate_mode mode, int reason)
+   { return -ENOSYS; }
 static inline int migrate_huge_page(struct page *page, new_page_t x,
-   unsigned long private, bool offlining,
-   enum migrate_mode mode) { return -ENOSYS; }
+   unsigned long private, enum migrate_mode mode)
+   { return -ENOSYS; }
 
 static inline int migrate_prep(void) { return -ENOSYS; }
 static inline int migrate_prep_local(void) { return -ENOSYS; }
--- mmotm.orig/mm/compaction.c  2013-01-24 12:28:38.740127550 -0800
+++ mmotm/mm/compaction.c   2013-01-25 14:38:51.472208776 -0800
@@ -980,7 +980,7 @@ static int compact_zone(struct zone *zon
 
nr_migrate = cc->nr_migratepages;
err = migrate_pages(>migratepages, compaction_alloc,
-   (unsigned long)cc, false,
+   (unsigned long)cc,
cc->sync ? MIGRATE_SYNC_LIGHT : MIGRATE_ASYNC,
MR_COMPACTION);
update_nr_listpages(cc);
--- mmotm.orig/mm/memory-failure.c  2013-01-24 12:28:38.740127550 -0800
+++ mmotm/mm/memory-failure.c   2013-01-25 14:38:51.472208776 -0800
@@ -1432,7 +1432,7 @@ static int soft_offline_huge_page(struct
goto done;
 
/* Keep page count to indicate a given hugepage is isolated. */
-   ret = migrate_huge_page(hpage, new_page, MPOL_MF_MOVE_ALL, false,
+   ret = migrate_huge_page(hpage, new_page, MPOL_MF_MOVE_ALL,
MIGRATE_SYNC);
put_page(hpage);
if (ret) {
@@ -1564,11 +1564,10 @@ int soft_offline_page(struct page *page,
if (!ret) {
LIST_HEAD(pagelist);
inc_zone_page_state(page, NR_ISOLATED_ANON +
-   page_is_file_cache(page));
+   page_is_file_cache(page));
list_add(>lru, );
ret = migrate_pages(, new_page, MPOL_MF_MOVE_ALL,
-   false, MIGRATE_SYNC,
-   MR_MEMORY_FAILURE);
+   MIGRATE_SYNC, MR_MEMORY_FAILURE);
if (ret) {
putback_lru_pages();
pr_info("soft offline: %#lx: migration failed %d, type 
%lx\n",
--- mmotm.orig/mm/memory_hotplug.c  2013-01-24 12:28:38.740127550 -0800
+++ mmotm/mm/memory_hotplug.c   2013-01-25 14:38:51.472208776 -0800
@@ -1283,8 +1283,7 @@ do_migrate_range(unsigned long start_pfn
 * migrate_pages returns # of failed pages.
 */
ret = migrate_pages(, alloc_migrate_target, 0,
-   true, MIGRATE_SYNC,
-   MR_MEMORY_HOTPLUG);
+   MIGRATE_SYNC, 

[PATCH 10/11] mm: remove offlining arg to migrate_pages

2013-01-25 Thread Hugh Dickins
No functional change, but the only purpose of the offlining argument
to migrate_pages() etc, was to ensure that __unmap_and_move() could
migrate a KSM page for memory hotremove (which took ksm_thread_mutex)
but not for other callers.  Now all cases are safe, remove the arg.

Signed-off-by: Hugh Dickins hu...@google.com
---
 include/linux/migrate.h |   14 ++
 mm/compaction.c |2 +-
 mm/memory-failure.c |7 +++
 mm/memory_hotplug.c |3 +--
 mm/mempolicy.c  |8 +++-
 mm/migrate.c|   35 +--
 mm/page_alloc.c |6 ++
 7 files changed, 29 insertions(+), 46 deletions(-)

--- mmotm.orig/include/linux/migrate.h  2013-01-24 12:28:38.740127550 -0800
+++ mmotm/include/linux/migrate.h   2013-01-25 14:38:51.468208776 -0800
@@ -40,11 +40,9 @@ extern void putback_movable_pages(struct
 extern int migrate_page(struct address_space *,
struct page *, struct page *, enum migrate_mode);
 extern int migrate_pages(struct list_head *l, new_page_t x,
-   unsigned long private, bool offlining,
-   enum migrate_mode mode, int reason);
+   unsigned long private, enum migrate_mode mode, int reason);
 extern int migrate_huge_page(struct page *, new_page_t x,
-   unsigned long private, bool offlining,
-   enum migrate_mode mode);
+   unsigned long private, enum migrate_mode mode);
 
 extern int fail_migrate_page(struct address_space *,
struct page *, struct page *);
@@ -62,11 +60,11 @@ extern int migrate_huge_page_move_mappin
 static inline void putback_lru_pages(struct list_head *l) {}
 static inline void putback_movable_pages(struct list_head *l) {}
 static inline int migrate_pages(struct list_head *l, new_page_t x,
-   unsigned long private, bool offlining,
-   enum migrate_mode mode, int reason) { return -ENOSYS; }
+   unsigned long private, enum migrate_mode mode, int reason)
+   { return -ENOSYS; }
 static inline int migrate_huge_page(struct page *page, new_page_t x,
-   unsigned long private, bool offlining,
-   enum migrate_mode mode) { return -ENOSYS; }
+   unsigned long private, enum migrate_mode mode)
+   { return -ENOSYS; }
 
 static inline int migrate_prep(void) { return -ENOSYS; }
 static inline int migrate_prep_local(void) { return -ENOSYS; }
--- mmotm.orig/mm/compaction.c  2013-01-24 12:28:38.740127550 -0800
+++ mmotm/mm/compaction.c   2013-01-25 14:38:51.472208776 -0800
@@ -980,7 +980,7 @@ static int compact_zone(struct zone *zon
 
nr_migrate = cc-nr_migratepages;
err = migrate_pages(cc-migratepages, compaction_alloc,
-   (unsigned long)cc, false,
+   (unsigned long)cc,
cc-sync ? MIGRATE_SYNC_LIGHT : MIGRATE_ASYNC,
MR_COMPACTION);
update_nr_listpages(cc);
--- mmotm.orig/mm/memory-failure.c  2013-01-24 12:28:38.740127550 -0800
+++ mmotm/mm/memory-failure.c   2013-01-25 14:38:51.472208776 -0800
@@ -1432,7 +1432,7 @@ static int soft_offline_huge_page(struct
goto done;
 
/* Keep page count to indicate a given hugepage is isolated. */
-   ret = migrate_huge_page(hpage, new_page, MPOL_MF_MOVE_ALL, false,
+   ret = migrate_huge_page(hpage, new_page, MPOL_MF_MOVE_ALL,
MIGRATE_SYNC);
put_page(hpage);
if (ret) {
@@ -1564,11 +1564,10 @@ int soft_offline_page(struct page *page,
if (!ret) {
LIST_HEAD(pagelist);
inc_zone_page_state(page, NR_ISOLATED_ANON +
-   page_is_file_cache(page));
+   page_is_file_cache(page));
list_add(page-lru, pagelist);
ret = migrate_pages(pagelist, new_page, MPOL_MF_MOVE_ALL,
-   false, MIGRATE_SYNC,
-   MR_MEMORY_FAILURE);
+   MIGRATE_SYNC, MR_MEMORY_FAILURE);
if (ret) {
putback_lru_pages(pagelist);
pr_info(soft offline: %#lx: migration failed %d, type 
%lx\n,
--- mmotm.orig/mm/memory_hotplug.c  2013-01-24 12:28:38.740127550 -0800
+++ mmotm/mm/memory_hotplug.c   2013-01-25 14:38:51.472208776 -0800
@@ -1283,8 +1283,7 @@ do_migrate_range(unsigned long start_pfn
 * migrate_pages returns # of failed pages.
 */
ret = migrate_pages(source, alloc_migrate_target, 0,
-   true, MIGRATE_SYNC,
-   MR_MEMORY_HOTPLUG);
+