diff options
author | Joonsoo Kim <iamjoonsoo.kim@lge.com> | 2014-01-21 18:51:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-21 19:19:49 -0500 |
commit | 59c82b70dcd9cc273c21fae5abc29e41fc732a17 (patch) | |
tree | 9d661f52eb6ba728be3ec926807088e7886da92c /mm/migrate.c | |
parent | 32665f2bbfed2e325d37236d9b0071a11a69124e (diff) |
mm/migrate: remove putback_lru_pages, fix comment on putback_movable_pages
Some part of putback_lru_pages() and putback_movable_pages() is
duplicated, so it could confuse us what we should use. We can remove
putback_lru_pages() since it is not really needed now. This makes us
undestand and maintain the code more easily.
And comment on putback_movable_pages() is stale now, so fix it.
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Rafael Aquini <aquini@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/migrate.c')
-rw-r--r-- | mm/migrate.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index 13bedcc4656b..8a73d66be102 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -72,28 +72,12 @@ int migrate_prep_local(void) | |||
72 | } | 72 | } |
73 | 73 | ||
74 | /* | 74 | /* |
75 | * Add isolated pages on the list back to the LRU under page lock | ||
76 | * to avoid leaking evictable pages back onto unevictable list. | ||
77 | */ | ||
78 | void putback_lru_pages(struct list_head *l) | ||
79 | { | ||
80 | struct page *page; | ||
81 | struct page *page2; | ||
82 | |||
83 | list_for_each_entry_safe(page, page2, l, lru) { | ||
84 | list_del(&page->lru); | ||
85 | dec_zone_page_state(page, NR_ISOLATED_ANON + | ||
86 | page_is_file_cache(page)); | ||
87 | putback_lru_page(page); | ||
88 | } | ||
89 | } | ||
90 | |||
91 | /* | ||
92 | * Put previously isolated pages back onto the appropriate lists | 75 | * Put previously isolated pages back onto the appropriate lists |
93 | * from where they were once taken off for compaction/migration. | 76 | * from where they were once taken off for compaction/migration. |
94 | * | 77 | * |
95 | * This function shall be used instead of putback_lru_pages(), | 78 | * This function shall be used whenever the isolated pageset has been |
96 | * whenever the isolated pageset has been built by isolate_migratepages_range() | 79 | * built from lru, balloon, hugetlbfs page. See isolate_migratepages_range() |
80 | * and isolate_huge_page(). | ||
97 | */ | 81 | */ |
98 | void putback_movable_pages(struct list_head *l) | 82 | void putback_movable_pages(struct list_head *l) |
99 | { | 83 | { |
@@ -1725,7 +1709,12 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma, | |||
1725 | nr_remaining = migrate_pages(&migratepages, alloc_misplaced_dst_page, | 1709 | nr_remaining = migrate_pages(&migratepages, alloc_misplaced_dst_page, |
1726 | node, MIGRATE_ASYNC, MR_NUMA_MISPLACED); | 1710 | node, MIGRATE_ASYNC, MR_NUMA_MISPLACED); |
1727 | if (nr_remaining) { | 1711 | if (nr_remaining) { |
1728 | putback_lru_pages(&migratepages); | 1712 | if (!list_empty(&migratepages)) { |
1713 | list_del(&page->lru); | ||
1714 | dec_zone_page_state(page, NR_ISOLATED_ANON + | ||
1715 | page_is_file_cache(page)); | ||
1716 | putback_lru_page(page); | ||
1717 | } | ||
1729 | isolated = 0; | 1718 | isolated = 0; |
1730 | } else | 1719 | } else |
1731 | count_vm_numa_event(NUMA_PAGE_MIGRATE); | 1720 | count_vm_numa_event(NUMA_PAGE_MIGRATE); |