lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160225190723.GY2854@techsingularity.net>
Date:	Thu, 25 Feb 2016 19:07:23 +0000
From:	Mel Gorman <mgorman@...hsingularity.net>
To:	Rik van Riel <riel@...hat.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Vlastimil Babka <vbabka@...e.cz>,
	Johannes Weiner <hannes@...xchg.org>,
	Andrea Arcangeli <aarcange@...hat.com>,
	Linux-MM <linux-mm@...ck.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] mm: thp: Redefine default THP defrag behaviour
 disable it by default

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@...hsingularity.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@...hat.com>

Thanks.

-- 
Mel Gorman
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ