From: Vlastimil Babka <vbabka@suse.cz>
To: Ebru Akagunduz <ebru.akagunduz@gmail.com>, linux-mm@kvack.org
Cc: akpm@linux-foundation.org, kirill@shutemov.name, mhocko@suse.cz,
mgorman@suse.de, rientjes@google.com, sasha.levin@oracle.com,
hughd@google.com, hannes@cmpxchg.org,
linux-kernel@vger.kernel.org, riel@redhat.com,
aarcange@redhat.com, zhangyanfei.linux@aliyun.com
Subject: Re: [PATCH v4] mm: incorporate read-only pages into transparent huge pages
Date: Fri, 30 Jan 2015 09:34:32 +0100 [thread overview]
Message-ID: <54CB4218.6000209@suse.cz> (raw)
In-Reply-To: <1422543547-12591-1-git-send-email-ebru.akagunduz@gmail.com>
On 01/29/2015 03:59 PM, Ebru Akagunduz wrote:
> This patch aims to improve THP collapse rates, by allowing
> THP collapse in the presence of read-only ptes, like those
> left in place by do_swap_page after a read fault.
>
> Currently THP can collapse 4kB pages into a THP when
> there are up to khugepaged_max_ptes_none pte_none ptes
> in a 2MB range. This patch applies the same limit for
> read-only ptes.
>
> The patch was tested with a test program that allocates
> 800MB of memory, writes to it, and then sleeps. I force
> the system to swap out all but 190MB of the program by
> touching other memory. Afterwards, the test program does
> a mix of reads and writes to its memory, and the memory
> gets swapped back in.
>
> Without the patch, only the memory that did not get
> swapped out remained in THPs, which corresponds to 24% of
> the memory of the program. The percentage did not increase
> over time.
>
> With this patch, after 5 minutes of waiting khugepaged had
> collapsed 60% of the program's memory back into THPs.
>
> Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
> Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
> Reviewed-by: Rik van Riel <riel@redhat.com>
> Acked-by: Vlastimil Babka <vbabka@suse.cz>
> Acked-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
> ---
> Changes in v2:
> - Remove extra code indent (Vlastimil Babka)
> - Add comment line for check condition of page_count() (Vlastimil Babka)
> - Add fast path optimistic check to
> __collapse_huge_page_isolate() (Andrea Arcangeli)
> - Move check condition of page_count() below to trylock_page() (Andrea Arcangeli)
>
> Changes in v3:
> - Add a at-least-one-writable-pte check (Zhang Yanfei)
> - Debug page count (Vlastimil Babka, Andrea Arcangeli)
> - Increase read-only pte counter if pte is none (Andrea Arcangeli)
>
> Changes in v4:
> - Remove read-only counter (Andrea Arcangeli)
> - Remove debug page count (Andrea Arcangeli)
> - Change type of writable as bool (Andrea Arcangeli)
> - Change type of referenced as bool (Vlastimil Babka)
> - Change comment line (Vlastimil Babka, Zhang Yanfei)
Looks good, thanks!
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-01-30 8:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-29 14:59 [PATCH v4] mm: incorporate read-only pages into transparent huge pages Ebru Akagunduz
2015-01-29 21:15 ` Andrea Arcangeli
2015-01-30 8:34 ` Vlastimil Babka [this message]
2015-01-30 9:58 ` 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=54CB4218.6000209@suse.cz \
--to=vbabka@suse.cz \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=ebru.akagunduz@gmail.com \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@suse.cz \
--cc=riel@redhat.com \
--cc=rientjes@google.com \
--cc=sasha.levin@oracle.com \
--cc=zhangyanfei.linux@aliyun.com \
/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).