diff options
Diffstat (limited to 'mm/migrate.c')
-rw-r--r-- | mm/migrate.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index d917ac3207f5..35e454189966 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -883,8 +883,9 @@ out: | |||
883 | * | 883 | * |
884 | * The function returns after 10 attempts or if no pages | 884 | * The function returns after 10 attempts or if no pages |
885 | * are movable anymore because to has become empty | 885 | * are movable anymore because to has become empty |
886 | * or no retryable pages exist anymore. All pages will be | 886 | * or no retryable pages exist anymore. |
887 | * returned to the LRU or freed. | 887 | * Caller should call putback_lru_pages to return pages to the LRU |
888 | * or free list. | ||
888 | * | 889 | * |
889 | * Return: Number of pages not migrated or error code. | 890 | * Return: Number of pages not migrated or error code. |
890 | */ | 891 | */ |
@@ -931,8 +932,6 @@ out: | |||
931 | if (!swapwrite) | 932 | if (!swapwrite) |
932 | current->flags &= ~PF_SWAPWRITE; | 933 | current->flags &= ~PF_SWAPWRITE; |
933 | 934 | ||
934 | putback_lru_pages(from); | ||
935 | |||
936 | if (rc) | 935 | if (rc) |
937 | return rc; | 936 | return rc; |
938 | 937 | ||
@@ -1087,9 +1086,12 @@ set_status: | |||
1087 | } | 1086 | } |
1088 | 1087 | ||
1089 | err = 0; | 1088 | err = 0; |
1090 | if (!list_empty(&pagelist)) | 1089 | if (!list_empty(&pagelist)) { |
1091 | err = migrate_pages(&pagelist, new_page_node, | 1090 | err = migrate_pages(&pagelist, new_page_node, |
1092 | (unsigned long)pm, 0); | 1091 | (unsigned long)pm, 0); |
1092 | if (err) | ||
1093 | putback_lru_pages(&pagelist); | ||
1094 | } | ||
1093 | 1095 | ||
1094 | up_read(&mm->mmap_sem); | 1096 | up_read(&mm->mmap_sem); |
1095 | return err; | 1097 | return err; |