linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: David Rientjes <rientjes@google.com>, Rik van Riel <riel@redhat.com>
Cc: Ebru Akagunduz <ebru.akagunduz@gmail.com>,
	linux-mm@kvack.org, akpm@linux-foundation.org,
	kirill@shutemov.name, mhocko@suse.cz, mgorman@suse.de,
	sasha.levin@oracle.com, hughd@google.com, hannes@cmpxchg.org,
	linux-kernel@vger.kernel.org, aarcange@redhat.com
Subject: Re: [PATCH] mm: set khugepaged_max_ptes_none by 1/8 of HPAGE_PMD_NR
Date: Mon, 02 Mar 2015 15:00:33 +0100	[thread overview]
Message-ID: <54F46D01.1030105@suse.cz> (raw)
In-Reply-To: <alpine.DEB.2.10.1502271300120.2122@chino.kir.corp.google.com>

On 02/27/2015 10:12 PM, David Rientjes wrote:
> On Fri, 27 Feb 2015, Rik van Riel wrote:
>
>> I think we do need to change the default.
>>
>> Why? See this bug:
>>
>>>> The problem was reported here:
>>>> https://bugzilla.kernel.org/show_bug.cgi?id=93111
>>
>> Now, there may be a better value than HPAGE_PMD_NR/8, but
>> I am not sure what it would be, or why.
>>
>> I do know that HPAGE_PMD_NR-1 results in undesired behaviour,
>> as seen in the bug above...
>>
>
> I know that the value of 64 would also be undesirable for Google since we
> tightly constrain memory usage, we have used max_ptes_none == 0 since it
> was introduced.   We can get away with that because our malloc() is
> modified to try to give back large contiguous ranges of memory
> periodically back to the system, also using madvise(MADV_DONTNEED), and
> tries to avoid splitting thp memory.
>
> The value is determined by how the system will be used: do you tightly
> constrain memory usage and not allow any unmapped memory be collapsed into
> a hugepage, or do you have an abundance of memory and really want an
> aggressive value like HPAGE_PMD_NR-1.  Depending on the properties of the
> system, you can tune this to anything you want just like we do in
> initscripts.
>
> I'm only concerned here about changing a default that has been around for
> four years and the possibly negative implications that will have on users
> who never touch this value.  They undoubtedly get less memory backed by
> thp, and that can lead to a performance regression.  So if this patch is
> merged and we get a bug report for the 4.1 kernel, do we tell that user
> that we changed behavior out from under them and to adjust the tunable
> back to HPAGE_PMD_NR-1?

Note that the new default has no effect on THP page faults which will 
still effectively act like max_ptes_none == 511. That means anyone who 
would notice this change of default has been relying on khugepaged, 
which is in its default settings quite slow, and (before other Ebru's 
patches) wouldn't collapse pmd's with zero pages or swapcache pages. So 
I think the chances of bug report due to the new default are lower than 
the bug 93111.

> Meanwhile, the bug report you cite has a workaround that has always been
> available for thp kernels:
> # echo 64 > /sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_none
>

--
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>

      reply	other threads:[~2015-03-02 14:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 18:26 Ebru Akagunduz
2015-02-27 20:53 ` David Rientjes
2015-02-27 20:57   ` Rik van Riel
2015-02-27 21:12     ` David Rientjes
2015-03-02 14:00       ` Vlastimil Babka [this message]

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=54F46D01.1030105@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