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] [day] [month] [year] [list]
Date:	Wed, 16 Jan 2013 09:50:20 -0600
From:	Rob Landley <rob@...dley.net>
To:	Andi Kleen <andi@...stfloor.org>
Cc:	John McCorquodale <mcq@...kgeek.org>, linux-kernel@...r.kernel.org
Subject: Re: Transparent Hugepage Nit

On 01/15/2013 03:26:58 PM, Andi Kleen wrote:
> John McCorquodale <mcq@...kgeek.org> writes:
> 
> > Suppose a hugepage-aligned mmap(MAP_ANONYMOUS) mapping has been  
> madvise()d
> > HUGEPAGE.  If a subeqeuent call to mremap() grows the mapping and  
> has to
> > move the mapping, the hugepage-alignment is not preserved in the  
> choice of
> > new address (in 3.7.2).
> >
> > I can workaround this by doing a 1-hugepage-oversized remap to find  
> a new
> > aligned address and then size it back down MREMAP_FIXED, but that's  
> probably
> > a lot of frags to 4k pages and back that aren't necessary.
> >
> > Should it not be the case that mremap(MAYMOVE) on something advised  
> hugepage
> > ALWAYS chooses a hugepage-aligned address?  This would be handy  
> when doing the
> > initial allocation too: mmap, madvise, mremap (to the same size) to  
> get
> > alignment.
> 
> The hole searching currently doesn't know anything about transparent
> huge pages. There were some discussions on fixing it. But it's
> essentially a trade off between memory fragmentation and huge page
> optimization: aggressively aligning to 2MB can lose address space
> in holes.
> 
> Usually if the program uses large enough mappings and enough memory
> it shouldn't be a problem.

Possibly we should just document that doing mremap() on a hugepage  
loses the hugepageness, and consider it pilot error to do that?

Rob--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ