From: Vlastimil Babka <vbabka@suse.cz>
To: Rik van Riel <riel@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Ebru Akagunduz <ebru.akagunduz@gmail.com>
Cc: linux-mm@kvack.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, aarcange@redhat.com
Subject: Re: [PATCH v2] mm: incorporate zero pages into transparent huge pages
Date: Thu, 19 Feb 2015 09:25:19 +0100 [thread overview]
Message-ID: <54E59DEF.2020807@suse.cz> (raw)
In-Reply-To: <54E5296C.5040806@redhat.com>
On 02/19/2015 01:08 AM, Rik van Riel wrote:
> On 02/18/2015 06:31 PM, Andrew Morton wrote:
>> On Wed, 11 Feb 2015 23:03:55 +0200 Ebru Akagunduz
>> <ebru.akagunduz@gmail.com> wrote:
>
>>> This patch improves THP collapse rates, by allowing zero pages.
>>>
>>> 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 counts pte none and mapped zero pages with the same
>>> variable.
>
>> So if I'm understanding this correctly, with the default value of
>> khugepaged_max_ptes_none (HPAGE_PMD_NR-1), if an application
>> creates a 2MB area which contains 511 mappings of the zero page and
>> one real page, the kernel will proceed to turn that area into a
>> real, physical huge page. So it consumes 2MB of memory which would
>> not have previously been allocated?
>
> This is equivalent to an application doing a write fault
> to a 2MB area that was previously untouched, going into
> do_huge_pmd_anonymous_page() and receiving a 2MB page.
>
>> If so, this might be rather undesirable behaviour in some
>> situations (and ditto the current behaviour for pte_none ptes)?
>
>> This can be tuned by adjusting khugepaged_max_ptes_none,
>
> The example of directly going into do_huge_pmd_anonymous_page()
> is not influenced by the tunable.
>
> It may indeed be undesirable in some situations, but I am
> not sure how to detect those...
Well, yeah. We seem to lack a setting to restrict page fault THP allocations to
e.g. madvise, while still letting khugepaged to collapse them later, taking
khugepaged_max_ptes_none into account.
--
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-02-19 8:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-11 21:03 Ebru Akagunduz
2015-02-11 22:16 ` Andrea Arcangeli
2015-02-11 22:21 ` Kirill A. Shutemov
2015-02-11 22:33 ` Andrea Arcangeli
2015-02-16 11:50 ` Vlastimil Babka
2015-02-18 23:31 ` Andrew Morton
2015-02-19 0:08 ` Rik van Riel
2015-02-19 8:25 ` Vlastimil Babka [this message]
2015-02-23 19:16 ` Andrew Morton
2015-02-23 19:43 ` Rik van Riel
2015-02-23 21:45 ` Vlastimil Babka
2015-02-20 18:02 ` Andrea Arcangeli
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=54E59DEF.2020807@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 \
/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