From: Mel Gorman <mgorman@techsingularity.net>
To: Rik van Riel <riel@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@suse.cz>,
Johannes Weiner <hannes@cmpxchg.org>,
Andrea Arcangeli <aarcange@redhat.com>,
Linux-MM <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] mm: thp: Redefine default THP defrag behaviour disable it by default
Date: Thu, 25 Feb 2016 19:07:23 +0000 [thread overview]
Message-ID: <20160225190723.GY2854@techsingularity.net> (raw)
In-Reply-To: <1456425170.15821.77.camel@redhat.com>
On Thu, Feb 25, 2016 at 01:32:50PM -0500, Rik van Riel wrote:
> On Thu, 2016-02-25 at 17:12 +0000, Mel Gorman wrote:
>
> > THP gives impressive gains in some cases but only if they are quickly
> > available. We're not going to reach the point where they are
> > completely
> > free so lets take the costs out of the fast paths finally and defer
> > the
> > cost to kswapd, kcompactd and khugepaged where it belongs.
> >
> > Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
>
> I agree with your conclusions, but with the caveat
> that if we do not try to defragment memory for THP
> at fault time, mlocked programs might not have any
> opportunity at all to get transparent huge pages.
>
> I wonder if we should consider mlock one of the slow
> paths where we should try to actually take the time
> to create THPs.
>
It would be a significant rework of mlock because it's not just mlocking
memory, it's doing something similar to khugepaged and actively trying
to collapse pages. I'm not against the idea as such but I'm not sure how
much of a benefit it would be really.
> Also, we might consider doing THP collapse from the
> NUMA page migration opportunistically, if there is a
> free 2MB page available on the destination host.
>
While not necessarily a bad idea, it goes back to an old problem whereby
there can be false sharing of NUMA pages within a THP boundary. Consider
for example if threads are calculating 4K blocks and then it gets migrated
as a THP including unrelated threads. It's not necessarily a win. We knew
that THP false sharing was a potential problem at the start but never went
much further than acknowleding it's a theoritical issue.
> Having said all that ...
>
> Acked-by: Rik van Riel <riel@redhat.com>
Thanks.
--
Mel Gorman
SUSE Labs
--
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:[~2016-02-25 19:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-25 17:12 [PATCH 1/1] mm: thp: Redefine default THP defrag behaviour disable it by default Mel Gorman
2016-02-25 18:32 ` Rik van Riel
2016-02-25 19:07 ` Mel Gorman [this message]
2016-02-25 19:01 ` Andrea Arcangeli
2016-02-25 19:56 ` Mel Gorman
2016-02-25 23:02 ` Andrea Arcangeli
2016-02-25 23:08 ` Andrea Arcangeli
2016-02-26 11:13 ` Mel Gorman
2016-02-26 19:50 ` Andrea Arcangeli
2016-02-26 20:46 ` Mel Gorman
2016-02-26 10:32 ` Kirill A. Shutemov
2016-03-02 18:47 ` Andrea Arcangeli
2016-02-25 19:45 ` Johannes Weiner
2016-02-26 10:52 ` Mel Gorman
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=20160225190723.GY2854@techsingularity.net \
--to=mgorman@techsingularity.net \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=riel@redhat.com \
--cc=vbabka@suse.cz \
/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).