Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mel Gorman and committed by
Linus Torvalds
7f0f2496 77f1fe6b

+14 -12
+4 -4
include/linux/migrate.h
··· 13 13 extern int migrate_page(struct address_space *, 14 14 struct page *, struct page *); 15 15 extern int migrate_pages(struct list_head *l, new_page_t x, 16 - unsigned long private, int offlining, 16 + unsigned long private, bool offlining, 17 17 bool sync); 18 18 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, 20 20 bool sync); 21 21 22 22 extern int fail_migrate_page(struct address_space *, ··· 35 35 36 36 static inline void putback_lru_pages(struct list_head *l) {} 37 37 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, 39 39 bool sync) { return -ENOSYS; } 40 40 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, 42 42 bool sync) { return -ENOSYS; } 43 43 44 44 static inline int migrate_prep(void) { return -ENOSYS; }
+1 -1
mm/compaction.c
··· 456 456 457 457 nr_migrate = cc->nr_migratepages; 458 458 migrate_pages(&cc->migratepages, compaction_alloc, 459 - (unsigned long)cc, 0, 459 + (unsigned long)cc, false, 460 460 cc->sync); 461 461 update_nr_listpages(cc); 462 462 nr_remaining = cc->nr_migratepages;
+1 -1
mm/memory_hotplug.c
··· 734 734 } 735 735 /* this function returns # of failed pages */ 736 736 ret = migrate_pages(&source, hotremove_migrate_alloc, 0, 737 - 1, true); 737 + true, true); 738 738 if (ret) 739 739 putback_lru_pages(&source); 740 740 }
+4 -2
mm/mempolicy.c
··· 935 935 return PTR_ERR(vma); 936 936 937 937 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); 939 940 if (err) 940 941 putback_lru_pages(&pagelist); 941 942 } ··· 1156 1155 1157 1156 if (!list_empty(&pagelist)) { 1158 1157 nr_failed = migrate_pages(&pagelist, new_vma_page, 1159 - (unsigned long)vma, 0, true); 1158 + (unsigned long)vma, 1159 + false, true); 1160 1160 if (nr_failed) 1161 1161 putback_lru_pages(&pagelist); 1162 1162 }
+4 -4
mm/migrate.c
··· 614 614 * to the newly allocated page in newpage. 615 615 */ 616 616 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) 618 618 { 619 619 int rc = 0; 620 620 int *result = NULL; ··· 827 827 */ 828 828 static int unmap_and_move_huge_page(new_page_t get_new_page, 829 829 unsigned long private, struct page *hpage, 830 - int force, int offlining, bool sync) 830 + int force, bool offlining, bool sync) 831 831 { 832 832 int rc = 0; 833 833 int *result = NULL; ··· 909 909 * Return: Number of pages not migrated or error code. 910 910 */ 911 911 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, 913 913 bool sync) 914 914 { 915 915 int retry = 1; ··· 960 960 } 961 961 962 962 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, 964 964 bool sync) 965 965 { 966 966 int retry = 1;