diff for duplicates of <87d11j4pdy.fsf@yhuang-dev.intel.com> diff --git a/a/1.txt b/N1/1.txt index 24de12d..3c2bc25 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -37,3 +37,67 @@ Best Regards, Huang, Ying ---------------------------------8<------------------------------- +>From 4c52d531680f91572ebc6f4525a018e32a934ef0 Mon Sep 17 00:00:00 2001 +From: Huang Ying <huang.ying.caritas@gmail.com> +Date: Mon, 5 Feb 2018 19:27:43 +0800 +Subject: [PATCH] fontswap thp fix + +--- + mm/page_io.c | 2 +- + mm/vmscan.c | 16 +++++++++++++--- + 2 files changed, 14 insertions(+), 4 deletions(-) + +diff --git a/mm/page_io.c b/mm/page_io.c +index b41cf9644585..6dca817ae7a0 100644 +--- a/mm/page_io.c ++++ b/mm/page_io.c +@@ -250,7 +250,7 @@ int swap_writepage(struct page *page, struct writeback_control *wbc) + unlock_page(page); + goto out; + } +- if (frontswap_store(page) == 0) { ++ if (!PageTransHuge(page) && frontswap_store(page) == 0) { + set_page_writeback(page); + unlock_page(page); + end_page_writeback(page); +diff --git a/mm/vmscan.c b/mm/vmscan.c +index bee53495a829..d1c1e00b08bb 100644 +--- a/mm/vmscan.c ++++ b/mm/vmscan.c +@@ -55,6 +55,7 @@ + + #include <linux/swapops.h> + #include <linux/balloon_compaction.h> ++#include <linux/frontswap.h> + + #include "internal.h" + +@@ -1063,14 +1064,23 @@ static unsigned long shrink_page_list(struct list_head *page_list, + /* cannot split THP, skip it */ + if (!can_split_huge_page(page, NULL)) + goto activate_locked; ++ /* ++ * Split THP if frontswap enabled, ++ * because it cannot process THP ++ */ ++ if (frontswap_enabled()) { ++ if (split_huge_page_to_list( ++ page, page_list)) ++ goto activate_locked; ++ } + /* + * Split pages without a PMD map right + * away. Chances are some or all of the + * tail pages can be freed without IO. + */ +- if (!compound_mapcount(page) && +- split_huge_page_to_list(page, +- page_list)) ++ else if (!compound_mapcount(page) && ++ split_huge_page_to_list(page, ++ page_list)) + goto activate_locked; + } + if (!add_to_swap(page)) { +-- +2.15.1 diff --git a/a/content_digest b/N1/content_digest index 71554b3..4990bce 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -15,7 +15,7 @@ Seth Jennings <sjenning@redhat.com> Dan Streetman <ddstreet@ieee.org> Kirill A . Shutemov <kirill.shutemov@linux.intel.com> - linux-mm@kvack.org + <linux-mm@kvack.org> " LKML <linux-kernel@vger.kernel.org>\0" "\00:1\0" "b\0" @@ -57,6 +57,70 @@ "Best Regards,\n" "Huang, Ying\n" "\n" - ---------------------------------8<------------------------------- + "---------------------------------8<-------------------------------\n" + ">From 4c52d531680f91572ebc6f4525a018e32a934ef0 Mon Sep 17 00:00:00 2001\n" + "From: Huang Ying <huang.ying.caritas@gmail.com>\n" + "Date: Mon, 5 Feb 2018 19:27:43 +0800\n" + "Subject: [PATCH] fontswap thp fix\n" + "\n" + "---\n" + " mm/page_io.c | 2 +-\n" + " mm/vmscan.c | 16 +++++++++++++---\n" + " 2 files changed, 14 insertions(+), 4 deletions(-)\n" + "\n" + "diff --git a/mm/page_io.c b/mm/page_io.c\n" + "index b41cf9644585..6dca817ae7a0 100644\n" + "--- a/mm/page_io.c\n" + "+++ b/mm/page_io.c\n" + "@@ -250,7 +250,7 @@ int swap_writepage(struct page *page, struct writeback_control *wbc)\n" + " \t\tunlock_page(page);\n" + " \t\tgoto out;\n" + " \t}\n" + "-\tif (frontswap_store(page) == 0) {\n" + "+\tif (!PageTransHuge(page) && frontswap_store(page) == 0) {\n" + " \t\tset_page_writeback(page);\n" + " \t\tunlock_page(page);\n" + " \t\tend_page_writeback(page);\n" + "diff --git a/mm/vmscan.c b/mm/vmscan.c\n" + "index bee53495a829..d1c1e00b08bb 100644\n" + "--- a/mm/vmscan.c\n" + "+++ b/mm/vmscan.c\n" + "@@ -55,6 +55,7 @@\n" + " \n" + " #include <linux/swapops.h>\n" + " #include <linux/balloon_compaction.h>\n" + "+#include <linux/frontswap.h>\n" + " \n" + " #include \"internal.h\"\n" + " \n" + "@@ -1063,14 +1064,23 @@ static unsigned long shrink_page_list(struct list_head *page_list,\n" + " \t\t\t\t\t/* cannot split THP, skip it */\n" + " \t\t\t\t\tif (!can_split_huge_page(page, NULL))\n" + " \t\t\t\t\t\tgoto activate_locked;\n" + "+\t\t\t\t\t/*\n" + "+\t\t\t\t\t * Split THP if frontswap enabled,\n" + "+\t\t\t\t\t * because it cannot process THP\n" + "+\t\t\t\t\t */\n" + "+\t\t\t\t\tif (frontswap_enabled()) {\n" + "+\t\t\t\t\t\tif (split_huge_page_to_list(\n" + "+\t\t\t\t\t\t\tpage, page_list))\n" + "+\t\t\t\t\t\t\tgoto activate_locked;\n" + "+\t\t\t\t\t}\n" + " \t\t\t\t\t/*\n" + " \t\t\t\t\t * Split pages without a PMD map right\n" + " \t\t\t\t\t * away. Chances are some or all of the\n" + " \t\t\t\t\t * tail pages can be freed without IO.\n" + " \t\t\t\t\t */\n" + "-\t\t\t\t\tif (!compound_mapcount(page) &&\n" + "-\t\t\t\t\t split_huge_page_to_list(page,\n" + "-\t\t\t\t\t\t\t\t page_list))\n" + "+\t\t\t\t\telse if (!compound_mapcount(page) &&\n" + "+\t\t\t\t\t\t split_huge_page_to_list(page,\n" + "+\t\t\t\t\t\t\tpage_list))\n" + " \t\t\t\t\t\tgoto activate_locked;\n" + " \t\t\t\t}\n" + " \t\t\t\tif (!add_to_swap(page)) {\n" + "-- \n" + 2.15.1 -dcd62d7be2c5d576d5ebe8a88ad1b63f48408533c68dd474050fa5f11b50e0e4 +d6539fd8736a47672162e39dc93440c932ffd8d03d2a6e0af9bc4d092bce97e7
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.