diff for duplicates of <20131210090012.GE24992@lge.com> diff --git a/a/1.txt b/N1/1.txt index 119b380..6e254b7 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -19,3 +19,110 @@ Here is the next version. Thanks. -----------8<------------------------ +>From 5495abbe8ed8a39712d733b08110dcf97e0b53f5 Mon Sep 17 00:00:00 2001 +From: Joonsoo Kim <iamjoonsoo.kim@lge.com> +Date: Fri, 6 Dec 2013 16:58:18 +0900 +Subject: [PATCH v2-fix 4/7] 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. + +Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> +Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> + +diff --git a/include/linux/migrate.h b/include/linux/migrate.h +index f5096b5..e4671f9 100644 +--- a/include/linux/migrate.h ++++ b/include/linux/migrate.h +@@ -35,7 +35,6 @@ enum migrate_reason { + + #ifdef CONFIG_MIGRATION + +-extern void putback_lru_pages(struct list_head *l); + extern void putback_movable_pages(struct list_head *l); + extern int migrate_page(struct address_space *, + struct page *, struct page *, enum migrate_mode); +@@ -58,7 +57,6 @@ extern int migrate_page_move_mapping(struct address_space *mapping, + struct buffer_head *head, enum migrate_mode mode); + #else + +-static inline void putback_lru_pages(struct list_head *l) {} + static inline void putback_movable_pages(struct list_head *l) {} + static inline int migrate_pages(struct list_head *l, new_page_t x, + unsigned long private, enum migrate_mode mode, int reason) +diff --git a/mm/memory-failure.c b/mm/memory-failure.c +index b7c1716..1debdea 100644 +--- a/mm/memory-failure.c ++++ b/mm/memory-failure.c +@@ -1569,7 +1569,13 @@ static int __soft_offline_page(struct page *page, int flags) + ret = migrate_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL, + MIGRATE_SYNC, MR_MEMORY_FAILURE); + if (ret) { +- putback_lru_pages(&pagelist); ++ if (!list_empty(&pagelist)) { ++ list_del(&page->lru); ++ dec_zone_page_state(page, NR_ISOLATED_ANON + ++ page_is_file_cache(page)); ++ putback_lru_page(page); ++ } ++ + pr_info("soft offline: %#lx: migration failed %d, type %lx\n", + pfn, ret, page->flags); + if (ret > 0) +diff --git a/mm/migrate.c b/mm/migrate.c +index b1cfd01..fa73ee3 100644 +--- a/mm/migrate.c ++++ b/mm/migrate.c +@@ -71,28 +71,12 @@ int migrate_prep_local(void) + } + + /* +- * Add isolated pages on the list back to the LRU under page lock +- * to avoid leaking evictable pages back onto unevictable list. +- */ +-void putback_lru_pages(struct list_head *l) +-{ +- struct page *page; +- struct page *page2; +- +- list_for_each_entry_safe(page, page2, l, lru) { +- list_del(&page->lru); +- dec_zone_page_state(page, NR_ISOLATED_ANON + +- page_is_file_cache(page)); +- putback_lru_page(page); +- } +-} +- +-/* + * Put previously isolated pages back onto the appropriate lists + * from where they were once taken off for compaction/migration. + * +- * This function shall be used instead of putback_lru_pages(), +- * whenever the isolated pageset has been built by isolate_migratepages_range() ++ * This function shall be used whenever the isolated pageset has been ++ * built from lru, balloon, hugetlbfs page. See isolate_migratepages_range() ++ * and isolate_huge_page(). + */ + void putback_movable_pages(struct list_head *l) + { +@@ -1704,7 +1688,12 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma, + nr_remaining = migrate_pages(&migratepages, alloc_misplaced_dst_page, + node, MIGRATE_ASYNC, MR_NUMA_MISPLACED); + if (nr_remaining) { +- putback_lru_pages(&migratepages); ++ if (!list_empty(&migratepages)) { ++ list_del(&page->lru); ++ dec_zone_page_state(page, NR_ISOLATED_ANON + ++ page_is_file_cache(page)); ++ putback_lru_page(page); ++ } + isolated = 0; + } else + count_vm_numa_event(NUMA_PAGE_MIGRATE); +-- +1.7.9.5 diff --git a/a/content_digest b/N1/content_digest index 2970fb3..8d02962 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -38,6 +38,113 @@ "Here is the next version.\n" "Thanks.\n" "\n" - -----------8<------------------------ + "-----------8<------------------------\n" + ">From 5495abbe8ed8a39712d733b08110dcf97e0b53f5 Mon Sep 17 00:00:00 2001\n" + "From: Joonsoo Kim <iamjoonsoo.kim@lge.com>\n" + "Date: Fri, 6 Dec 2013 16:58:18 +0900\n" + "Subject: [PATCH v2-fix 4/7] mm/migrate: remove putback_lru_pages, fix comment\n" + " on putback_movable_pages\n" + "\n" + "Some part of putback_lru_pages() and putback_movable_pages() is\n" + "duplicated, so it could confuse us what we should use.\n" + "We can remove putback_lru_pages() since it is not really needed now.\n" + "This makes us undestand and maintain the code more easily.\n" + "\n" + "And comment on putback_movable_pages() is stale now, so fix it.\n" + "\n" + "Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>\n" + "Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>\n" + "\n" + "diff --git a/include/linux/migrate.h b/include/linux/migrate.h\n" + "index f5096b5..e4671f9 100644\n" + "--- a/include/linux/migrate.h\n" + "+++ b/include/linux/migrate.h\n" + "@@ -35,7 +35,6 @@ enum migrate_reason {\n" + " \n" + " #ifdef CONFIG_MIGRATION\n" + " \n" + "-extern void putback_lru_pages(struct list_head *l);\n" + " extern void putback_movable_pages(struct list_head *l);\n" + " extern int migrate_page(struct address_space *,\n" + " \t\t\tstruct page *, struct page *, enum migrate_mode);\n" + "@@ -58,7 +57,6 @@ extern int migrate_page_move_mapping(struct address_space *mapping,\n" + " \t\tstruct buffer_head *head, enum migrate_mode mode);\n" + " #else\n" + " \n" + "-static inline void putback_lru_pages(struct list_head *l) {}\n" + " static inline void putback_movable_pages(struct list_head *l) {}\n" + " static inline int migrate_pages(struct list_head *l, new_page_t x,\n" + " \t\tunsigned long private, enum migrate_mode mode, int reason)\n" + "diff --git a/mm/memory-failure.c b/mm/memory-failure.c\n" + "index b7c1716..1debdea 100644\n" + "--- a/mm/memory-failure.c\n" + "+++ b/mm/memory-failure.c\n" + "@@ -1569,7 +1569,13 @@ static int __soft_offline_page(struct page *page, int flags)\n" + " \t\tret = migrate_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL,\n" + " \t\t\t\t\tMIGRATE_SYNC, MR_MEMORY_FAILURE);\n" + " \t\tif (ret) {\n" + "-\t\t\tputback_lru_pages(&pagelist);\n" + "+\t\t\tif (!list_empty(&pagelist)) {\n" + "+\t\t\t\tlist_del(&page->lru);\n" + "+\t\t\t\tdec_zone_page_state(page, NR_ISOLATED_ANON +\n" + "+\t\t\t\t\t\tpage_is_file_cache(page));\n" + "+\t\t\t\tputback_lru_page(page);\n" + "+\t\t\t}\n" + "+\n" + " \t\t\tpr_info(\"soft offline: %#lx: migration failed %d, type %lx\\n\",\n" + " \t\t\t\tpfn, ret, page->flags);\n" + " \t\t\tif (ret > 0)\n" + "diff --git a/mm/migrate.c b/mm/migrate.c\n" + "index b1cfd01..fa73ee3 100644\n" + "--- a/mm/migrate.c\n" + "+++ b/mm/migrate.c\n" + "@@ -71,28 +71,12 @@ int migrate_prep_local(void)\n" + " }\n" + " \n" + " /*\n" + "- * Add isolated pages on the list back to the LRU under page lock\n" + "- * to avoid leaking evictable pages back onto unevictable list.\n" + "- */\n" + "-void putback_lru_pages(struct list_head *l)\n" + "-{\n" + "-\tstruct page *page;\n" + "-\tstruct page *page2;\n" + "-\n" + "-\tlist_for_each_entry_safe(page, page2, l, lru) {\n" + "-\t\tlist_del(&page->lru);\n" + "-\t\tdec_zone_page_state(page, NR_ISOLATED_ANON +\n" + "-\t\t\t\tpage_is_file_cache(page));\n" + "-\t\t\tputback_lru_page(page);\n" + "-\t}\n" + "-}\n" + "-\n" + "-/*\n" + " * Put previously isolated pages back onto the appropriate lists\n" + " * from where they were once taken off for compaction/migration.\n" + " *\n" + "- * This function shall be used instead of putback_lru_pages(),\n" + "- * whenever the isolated pageset has been built by isolate_migratepages_range()\n" + "+ * This function shall be used whenever the isolated pageset has been\n" + "+ * built from lru, balloon, hugetlbfs page. See isolate_migratepages_range()\n" + "+ * and isolate_huge_page().\n" + " */\n" + " void putback_movable_pages(struct list_head *l)\n" + " {\n" + "@@ -1704,7 +1688,12 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma,\n" + " \tnr_remaining = migrate_pages(&migratepages, alloc_misplaced_dst_page,\n" + " \t\t\t\t node, MIGRATE_ASYNC, MR_NUMA_MISPLACED);\n" + " \tif (nr_remaining) {\n" + "-\t\tputback_lru_pages(&migratepages);\n" + "+\t\tif (!list_empty(&migratepages)) {\n" + "+\t\t\tlist_del(&page->lru);\n" + "+\t\t\tdec_zone_page_state(page, NR_ISOLATED_ANON +\n" + "+\t\t\t\t\tpage_is_file_cache(page));\n" + "+\t\t\tputback_lru_page(page);\n" + "+\t\t}\n" + " \t\tisolated = 0;\n" + " \t} else\n" + " \t\tcount_vm_numa_event(NUMA_PAGE_MIGRATE);\n" + "-- \n" + 1.7.9.5 -a3582fe84ede529e12586d88bb1e6786e41b941ce81edd969776e9fa5ad6cf29 +00f60073e3b53246809dd2838aecf9c808f87e57a4838fc4f1607dd4d7af30aa
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.