From: Yang Shi <shy828301@gmail.com>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Andrea Arcangeli <aarcange@redhat.com>,
Linux MM <linux-mm@kvack.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Subject: Re: [PATCH 2/7] khugepaged: Do not stop collapse if less than half PTEs are referenced
Date: Fri, 27 Mar 2020 10:46:55 -0700 [thread overview]
Message-ID: <CAHbLzkom4C0qBdMouJF4U+C2my6qySyS6oM3v3Pihx68jfmUzQ@mail.gmail.com> (raw)
In-Reply-To: <20200327170601.18563-3-kirill.shutemov@linux.intel.com>
On Fri, Mar 27, 2020 at 10:06 AM Kirill A. Shutemov
<kirill@shutemov.name> wrote:
>
> __collapse_huge_page_swapin() check number of referenced PTE to decide
> if the memory range is hot enough to justify swapin.
>
> The problem is that it stops collapse altogether if there's not enough
> refereced pages, not only swappingin.
s/refereced/referenced
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Fixes: 0db501f7a34c ("mm, thp: convert from optimistic swapin collapsing to conservative")
> ---
> mm/khugepaged.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> index 99bab7e4d05b..14d7afc90786 100644
> --- a/mm/khugepaged.c
> +++ b/mm/khugepaged.c
> @@ -905,7 +905,8 @@ static bool __collapse_huge_page_swapin(struct mm_struct *mm,
> /* 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;
> + /* Do not block collapse, only skip swapping in */
> + return true;
> }
> vmf.pte = pte_offset_map(pmd, address);
> for (; vmf.address < address + HPAGE_PMD_NR*PAGE_SIZE;
> --
> 2.26.0
>
>
next prev parent reply other threads:[~2020-03-27 17:47 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-27 17:05 [PATCH 0/7] thp/khugepaged improvements and CoW semantics Kirill A. Shutemov
2020-03-27 17:05 ` [PATCH 1/7] khugepaged: Add self test Kirill A. Shutemov
2020-03-27 17:05 ` [PATCH 2/7] khugepaged: Do not stop collapse if less than half PTEs are referenced Kirill A. Shutemov
2020-03-27 17:30 ` Zi Yan
2020-03-27 17:46 ` Yang Shi [this message]
2020-03-27 17:05 ` [PATCH 3/7] khugepaged: Drain LRU add pagevec to get rid of extra pins Kirill A. Shutemov
2020-03-27 17:34 ` Zi Yan
2020-03-28 0:20 ` Kirill A. Shutemov
2020-03-27 18:10 ` Yang Shi
2020-03-28 12:18 ` Kirill A. Shutemov
2020-03-30 18:30 ` Yang Shi
2020-03-30 21:38 ` Kirill A. Shutemov
2020-03-27 17:05 ` [PATCH 4/7] khugepaged: Allow to callapse a page shared across fork Kirill A. Shutemov
2020-03-27 18:19 ` Zi Yan
2020-03-27 21:31 ` Yang Shi
2020-03-27 21:44 ` Zi Yan
2020-03-27 17:05 ` [PATCH 5/7] khugepaged: Allow to collapse PTE-mapped compound pages Kirill A. Shutemov
2020-03-27 18:53 ` Yang Shi
2020-03-28 0:34 ` Kirill A. Shutemov
2020-03-28 1:09 ` Yang Shi
2020-03-28 12:27 ` Kirill A. Shutemov
2020-03-30 18:38 ` Yang Shi
2020-03-27 18:55 ` Zi Yan
2020-03-28 0:39 ` Kirill A. Shutemov
2020-03-28 1:17 ` Zi Yan
2020-03-28 12:33 ` Kirill A. Shutemov
2020-03-30 18:41 ` Yang Shi
2020-03-30 18:50 ` Yang Shi
2020-03-31 14:08 ` Kirill A. Shutemov
2020-04-01 19:45 ` Yang Shi
2020-03-27 20:45 ` Yang Shi
2020-03-28 0:40 ` Kirill A. Shutemov
2020-03-28 1:12 ` Yang Shi
2020-03-27 17:06 ` [PATCH 6/7] thp: Change CoW semantics for anon-THP Kirill A. Shutemov
2020-03-27 20:07 ` Yang Shi
2020-03-28 0:43 ` Kirill A. Shutemov
2020-03-28 1:30 ` Yang Shi
2020-03-27 17:06 ` [PATCH 7/7] khugepaged: Introduce 'max_ptes_shared' tunable Kirill A. Shutemov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHbLzkom4C0qBdMouJF4U+C2my6qySyS6oM3v3Pihx68jfmUzQ@mail.gmail.com \
--to=shy828301@gmail.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).