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>] [day] [month] [year] [list]
Date:   Tue, 17 Jul 2018 16:56:53 -0700
From:   Mike Kravetz <mike.kravetz@...cle.com>
To:     David Frank <david_frank95@...oo.com>,
        Kernelnewbies <kernelnewbies@...nelnewbies.org>,
        Linux-mm <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: mmap with huge page

On 07/17/2018 12:05 PM, David Frank wrote:
> Hi,
> According to the instruction, I have to mount a huge directory to hugetlbfs and create file in the huge directory to use the mmap huge page feature. But the issue is that, the files in the huge directory takes up the huge pages configured through
> vm.nr_hugepages =
> 
> even the files are not used.
> 
> When the total size of the files in the huge directory = vm.nr_hugepages * huge page size, then mmap would fail with 'can not allocate memory' if the file to be  mapped is in the huge dir or the call has HUGEPAGETLB flag.
> 
> Basically, I have to move the files off of the huge directory to free up huge pages.
> 
> Am I missing anything here?
> 

No, that is working as designed.

hugetlbfs filesystems are generally pre-allocated with nr_hugepages
huge pages.  That is the upper limit of huge pages available.  You can
use overcommit/surplus pages to try and exceed the limit, but that
comes with a whole set of potential issues.

If you have not done so already, please see Documentation/vm/hugetlbpage.txt
in the kernel source tree.
-- 
Mike Kravetz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ