All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-thp-fix-leaking-mapped-pte-in-__collapse_huge_page_swapin.patch added to -mm tree
@ 2016-09-02 20:44 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2016-09-02 20:44 UTC (permalink / raw)
  To: ebru.akagunduz, aarcange, hannes, kirill.shutemov, mgorman, riel,
	vbabka, mm-commits


The patch titled
     Subject: mm, thp: fix leaking mapped pte in __collapse_huge_page_swapin()
has been added to the -mm tree.  Its filename is
     mm-thp-fix-leaking-mapped-pte-in-__collapse_huge_page_swapin.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-thp-fix-leaking-mapped-pte-in-__collapse_huge_page_swapin.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-thp-fix-leaking-mapped-pte-in-__collapse_huge_page_swapin.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Subject: mm, thp: fix leaking mapped pte in __collapse_huge_page_swapin()

Currently, khugepaged does not permit swapin if there are enough young
pages in a THP.  The problem is when a THP does not have enough young
pages, khugepaged leaks mapped ptes.

This patch prohibits leaking mapped ptes.

Link: http://lkml.kernel.org/r/1472820276-7831-1-git-send-email-ebru.akagunduz@gmail.com
Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Suggested-by: Andrea Arcangeli <aarcange@redhat.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/khugepaged.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff -puN mm/khugepaged.c~mm-thp-fix-leaking-mapped-pte-in-__collapse_huge_page_swapin mm/khugepaged.c
--- a/mm/khugepaged.c~mm-thp-fix-leaking-mapped-pte-in-__collapse_huge_page_swapin
+++ a/mm/khugepaged.c
@@ -881,6 +881,11 @@ static bool __collapse_huge_page_swapin(
 		.pmd = pmd,
 	};
 
+	/* we only decide to swapin, if there is enough young ptes */
+	if (referenced < HPAGE_PMD_NR/2) {
+		trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 0);
+		return false;
+	}
 	fe.pte = pte_offset_map(pmd, address);
 	for (; fe.address < address + HPAGE_PMD_NR*PAGE_SIZE;
 			fe.pte++, fe.address += PAGE_SIZE) {
@@ -888,11 +893,6 @@ static bool __collapse_huge_page_swapin(
 		if (!is_swap_pte(pteval))
 			continue;
 		swapped_in++;
-		/* we only decide to swapin, if there is enough young ptes */
-		if (referenced < HPAGE_PMD_NR/2) {
-			trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, 0);
-			return false;
-		}
 		ret = do_swap_page(&fe, pteval);
 
 		/* do_swap_page returns VM_FAULT_RETRY with released mmap_sem */
_

Patches currently in -mm which might be from ebru.akagunduz@gmail.com are

mm-thp-fix-leaking-mapped-pte-in-__collapse_huge_page_swapin.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-09-02 20:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-02 20:44 + mm-thp-fix-leaking-mapped-pte-in-__collapse_huge_page_swapin.patch added to -mm tree akpm

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.