Skip to content

Commit 7f0f249

Browse files
gormanmtorvalds
authored andcommitted
mm: migration: cleanup migrate_pages API by matching types for offlining and sync
With the introduction of the boolean sync parameter, the API looks a little inconsistent as offlining is still an int. Convert offlining to a bool for the sake of being tidy. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Rik van Riel <riel@redhat.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 77f1fe6 commit 7f0f249

5 files changed

Lines changed: 14 additions & 12 deletions

File tree

‎include/linux/migrate.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ extern void putback_lru_pages(struct list_head *l);
1313
extern int migrate_page(struct address_space *,
1414
struct page *, struct page *);
1515
extern int migrate_pages(struct list_head *l, new_page_t x,
16-
unsigned long private, int offlining,
16+
unsigned long private, bool offlining,
1717
bool sync);
1818
extern int migrate_huge_pages(struct list_head *l, new_page_t x,
19-
unsigned long private, int offlining,
19+
unsigned long private, bool offlining,
2020
bool sync);
2121

2222
extern int fail_migrate_page(struct address_space *,
@@ -35,10 +35,10 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping,
3535

3636
static inline void putback_lru_pages(struct list_head *l) {}
3737
static inline int migrate_pages(struct list_head *l, new_page_t x,
38-
unsigned long private, int offlining,
38+
unsigned long private, bool offlining,
3939
bool sync) { return -ENOSYS; }
4040
static inline int migrate_huge_pages(struct list_head *l, new_page_t x,
41-
unsigned long private, int offlining,
41+
unsigned long private, bool offlining,
4242
bool sync) { return -ENOSYS; }
4343

4444
static inline int migrate_prep(void) { return -ENOSYS; }

‎mm/compaction.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
456456

457457
nr_migrate = cc->nr_migratepages;
458458
migrate_pages(&cc->migratepages, compaction_alloc,
459-
(unsigned long)cc, 0,
459+
(unsigned long)cc, false,
460460
cc->sync);
461461
update_nr_listpages(cc);
462462
nr_remaining = cc->nr_migratepages;

‎mm/memory_hotplug.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
734734
}
735735
/* this function returns # of failed pages */
736736
ret = migrate_pages(&source, hotremove_migrate_alloc, 0,
737-
1, true);
737+
true, true);
738738
if (ret)
739739
putback_lru_pages(&source);
740740
}

‎mm/mempolicy.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,8 @@ static int migrate_to_node(struct mm_struct *mm, int source, int dest,
935935
return PTR_ERR(vma);
936936

937937
if (!list_empty(&pagelist)) {
938-
err = migrate_pages(&pagelist, new_node_page, dest, 0, true);
938+
err = migrate_pages(&pagelist, new_node_page, dest,
939+
false, true);
939940
if (err)
940941
putback_lru_pages(&pagelist);
941942
}
@@ -1155,7 +1156,8 @@ static long do_mbind(unsigned long start, unsigned long len,
11551156

11561157
if (!list_empty(&pagelist)) {
11571158
nr_failed = migrate_pages(&pagelist, new_vma_page,
1158-
(unsigned long)vma, 0, true);
1159+
(unsigned long)vma,
1160+
false, true);
11591161
if (nr_failed)
11601162
putback_lru_pages(&pagelist);
11611163
}

‎mm/migrate.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ static int move_to_new_page(struct page *newpage, struct page *page,
614614
* to the newly allocated page in newpage.
615615
*/
616616
static int unmap_and_move(new_page_t get_new_page, unsigned long private,
617-
struct page *page, int force, int offlining, bool sync)
617+
struct page *page, int force, bool offlining, bool sync)
618618
{
619619
int rc = 0;
620620
int *result = NULL;
@@ -827,7 +827,7 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
827827
*/
828828
static int unmap_and_move_huge_page(new_page_t get_new_page,
829829
unsigned long private, struct page *hpage,
830-
int force, int offlining, bool sync)
830+
int force, bool offlining, bool sync)
831831
{
832832
int rc = 0;
833833
int *result = NULL;
@@ -909,7 +909,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
909909
* Return: Number of pages not migrated or error code.
910910
*/
911911
int migrate_pages(struct list_head *from,
912-
new_page_t get_new_page, unsigned long private, int offlining,
912+
new_page_t get_new_page, unsigned long private, bool offlining,
913913
bool sync)
914914
{
915915
int retry = 1;
@@ -960,7 +960,7 @@ int migrate_pages(struct list_head *from,
960960
}
961961

962962
int migrate_huge_pages(struct list_head *from,
963-
new_page_t get_new_page, unsigned long private, int offlining,
963+
new_page_t get_new_page, unsigned long private, bool offlining,
964964
bool sync)
965965
{
966966
int retry = 1;

0 commit comments

Comments
 (0)