diff for duplicates of <20160428232127.GL11700@redhat.com> diff --git a/a/1.txt b/N1/1.txt index e724768..2b1be3b 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -23,3 +23,36 @@ course is when we really need a COW, we'll waste an additional 32k, but then it doesn't matter that much as we'd be forced to load 4MB of cache anyway in such case. There's room for optimizations but even the simple below patch would be ok for now. + +>From 09e3d1ff10b49fb9c3ab77f0b96a862848e30067 Mon Sep 17 00:00:00 2001 +From: Andrea Arcangeli <aarcange@redhat.com> +Date: Fri, 29 Apr 2016 01:05:06 +0200 +Subject: [PATCH 1/1] mm: thp: calculate page_mapcount() correctly for THP + pages + +This allows to revert commit 1f25fe20a76af0d960172fb104d4b13697cafa84 +and it provides fully accuracy with wrprotect faults so page pinning +will stop causing false positive copy-on-writes. + +Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> +--- + mm/util.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/mm/util.c b/mm/util.c +index 6cc81e7..a0b9f63 100644 +--- a/mm/util.c ++++ b/mm/util.c +@@ -383,9 +383,10 @@ struct address_space *page_mapping(struct page *page) + /* Slow path of page_mapcount() for compound pages */ + int __page_mapcount(struct page *page) + { +- int ret; ++ int ret = 0, i; + +- ret = atomic_read(&page->_mapcount) + 1; ++ for (i = 0; i < HPAGE_PMD_NR; i++) ++ ret = max(ret, atomic_read(&page->_mapcount) + 1); + page = compound_head(page); + ret += atomic_read(compound_mapcount_ptr(page)) + 1; + if (PageDoubleMap(page)) diff --git a/a/content_digest b/N1/content_digest index d5a70f2..60cce7a 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -35,6 +35,39 @@ "course is when we really need a COW, we'll waste an additional 32k,\n" "but then it doesn't matter that much as we'd be forced to load 4MB of\n" "cache anyway in such case. There's room for optimizations but even the\n" - simple below patch would be ok for now. + "simple below patch would be ok for now.\n" + "\n" + ">From 09e3d1ff10b49fb9c3ab77f0b96a862848e30067 Mon Sep 17 00:00:00 2001\n" + "From: Andrea Arcangeli <aarcange@redhat.com>\n" + "Date: Fri, 29 Apr 2016 01:05:06 +0200\n" + "Subject: [PATCH 1/1] mm: thp: calculate page_mapcount() correctly for THP\n" + " pages\n" + "\n" + "This allows to revert commit 1f25fe20a76af0d960172fb104d4b13697cafa84\n" + "and it provides fully accuracy with wrprotect faults so page pinning\n" + "will stop causing false positive copy-on-writes.\n" + "\n" + "Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>\n" + "---\n" + " mm/util.c | 5 +++--\n" + " 1 file changed, 3 insertions(+), 2 deletions(-)\n" + "\n" + "diff --git a/mm/util.c b/mm/util.c\n" + "index 6cc81e7..a0b9f63 100644\n" + "--- a/mm/util.c\n" + "+++ b/mm/util.c\n" + "@@ -383,9 +383,10 @@ struct address_space *page_mapping(struct page *page)\n" + " /* Slow path of page_mapcount() for compound pages */\n" + " int __page_mapcount(struct page *page)\n" + " {\n" + "-\tint ret;\n" + "+\tint ret = 0, i;\n" + " \n" + "-\tret = atomic_read(&page->_mapcount) + 1;\n" + "+\tfor (i = 0; i < HPAGE_PMD_NR; i++)\n" + "+\t\tret = max(ret, atomic_read(&page->_mapcount) + 1);\n" + " \tpage = compound_head(page);\n" + " \tret += atomic_read(compound_mapcount_ptr(page)) + 1;\n" + " \tif (PageDoubleMap(page))" -94af0165637d300b1eece431f7d4655bc12ca966c55b52f3ace035dc006eacd5 +569b7820e1e62e881102bf85d72906eff23f922f928c43c61be727b1be7f08bc
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.