aboutsummaryrefslogtreecommitdiffstats
path: root/mm/migrate.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-26 20:15:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-26 20:15:20 -0400
commit31453a9764f7e2a72a6e2c502ace586e2663a68c (patch)
tree5d4db63de5b4b85d1ffdab4e95a75175a784a10a /mm/migrate.c
parentf9ba5375a8aae4aeea6be15df77e24707a429812 (diff)
parent93ed0e2d07b25aff4db1d61bfbcd1e82074c0ad5 (diff)
Merge branch 'akpm-incoming-1'
* akpm-incoming-1: (176 commits) scripts/checkpatch.pl: add check for declaration of pci_device_id scripts/checkpatch.pl: add warnings for static char that could be static const char checkpatch: version 0.31 checkpatch: statement/block context analyser should look at sanitised lines checkpatch: handle EXPORT_SYMBOL for DEVICE_ATTR and similar checkpatch: clean up structure definition macro handline checkpatch: update copyright dates checkpatch: Add additional attribute #defines checkpatch: check for incorrect permissions checkpatch: ensure kconfig help checks only apply when we are adding help checkpatch: simplify and consolidate "missing space after" checks checkpatch: add check for space after struct, union, and enum checkpatch: returning errno typically should be negative checkpatch: handle casts better fixing false categorisation of : as binary checkpatch: ensure we do not collapse bracketed sections into constants checkpatch: suggest cleanpatch and cleanfile when appropriate checkpatch: types may sit on a line on their own checkpatch: fix regressions in "fix handling of leading spaces" div64_u64(): improve precision on 32bit platforms lib/parser: cleanup match_number() ...
Diffstat (limited to 'mm/migrate.c')
-rw-r--r--mm/migrate.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index f8c9bccf2520..fe5a3c6a5426 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -497,7 +497,6 @@ static int writeout(struct address_space *mapping, struct page *page)
497 .nr_to_write = 1, 497 .nr_to_write = 1,
498 .range_start = 0, 498 .range_start = 0,
499 .range_end = LLONG_MAX, 499 .range_end = LLONG_MAX,
500 .nonblocking = 1,
501 .for_reclaim = 1 500 .for_reclaim = 1
502 }; 501 };
503 int rc; 502 int rc;
@@ -884,8 +883,9 @@ out:
884 * 883 *
885 * The function returns after 10 attempts or if no pages 884 * The function returns after 10 attempts or if no pages
886 * are movable anymore because to has become empty 885 * are movable anymore because to has become empty
887 * or no retryable pages exist anymore. All pages will be 886 * or no retryable pages exist anymore.
888 * returned to the LRU or freed. 887 * Caller should call putback_lru_pages to return pages to the LRU
888 * or free list.
889 * 889 *
890 * Return: Number of pages not migrated or error code. 890 * Return: Number of pages not migrated or error code.
891 */ 891 */
@@ -932,8 +932,6 @@ out:
932 if (!swapwrite) 932 if (!swapwrite)
933 current->flags &= ~PF_SWAPWRITE; 933 current->flags &= ~PF_SWAPWRITE;
934 934
935 putback_lru_pages(from);
936
937 if (rc) 935 if (rc)
938 return rc; 936 return rc;
939 937
@@ -1039,7 +1037,7 @@ static int do_move_page_to_node_array(struct mm_struct *mm,
1039 1037
1040 err = -EFAULT; 1038 err = -EFAULT;
1041 vma = find_vma(mm, pp->addr); 1039 vma = find_vma(mm, pp->addr);
1042 if (!vma || !vma_migratable(vma)) 1040 if (!vma || pp->addr < vma->vm_start || !vma_migratable(vma))
1043 goto set_status; 1041 goto set_status;
1044 1042
1045 page = follow_page(vma, pp->addr, FOLL_GET); 1043 page = follow_page(vma, pp->addr, FOLL_GET);
@@ -1088,9 +1086,12 @@ set_status:
1088 } 1086 }
1089 1087
1090 err = 0; 1088 err = 0;
1091 if (!list_empty(&pagelist)) 1089 if (!list_empty(&pagelist)) {
1092 err = migrate_pages(&pagelist, new_page_node, 1090 err = migrate_pages(&pagelist, new_page_node,
1093 (unsigned long)pm, 0); 1091 (unsigned long)pm, 0);
1092 if (err)
1093 putback_lru_pages(&pagelist);
1094 }
1094 1095
1095 up_read(&mm->mmap_sem); 1096 up_read(&mm->mmap_sem);
1096 return err; 1097 return err;
@@ -1203,7 +1204,7 @@ static void do_pages_stat_array(struct mm_struct *mm, unsigned long nr_pages,
1203 int err = -EFAULT; 1204 int err = -EFAULT;
1204 1205
1205 vma = find_vma(mm, addr); 1206 vma = find_vma(mm, addr);
1206 if (!vma) 1207 if (!vma || addr < vma->vm_start)
1207 goto set_status; 1208 goto set_status;
1208 1209
1209 page = follow_page(vma, addr, 0); 1210 page = follow_page(vma, addr, 0);