Deutsch   English   Français   Italiano  
<vbiocv$1j26j$14@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Lawrence D'Oliveiro <ldo@nz.invalid>
Newsgroups: comp.arch
Subject: Re: transparent huge pages (was: Address bits again)
Date: Sat, 7 Sep 2024 23:42:23 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <vbiocv$1j26j$14@dont-email.me>
References: <vb9r4g$2o1f$1@gal.iecc.com>
	<memo.20240904163805.19028V@jgd.cix.co.uk>
	<Cu0CO.120079$8jx2.14596@fx17.iad>
	<2024Sep5.154513@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 08 Sep 2024 01:42:24 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="5b47ecd330ac087ccb2ea7289cdcbed3";
	logging-data="1673427"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/JHhsrQDapzAypdfBYmKXL"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:iXE/OMyEPsZv/zOx341nDwJ8CPY=
Bytes: 1915

On Thu, 05 Sep 2024 13:45:13 GMT, Anton Ertl wrote:

> Recently, I thought that by using a 2MB size for an mmap()-allocated
> memory block I would get THP on Linux.  Unfortunately, mmap() does not
> aligng 2MB blocks to 2MB boundaries, and if it does not, the block is
> not eligible for THP.

Checking the mmap(2) man page, I saw these:

   MAP_HUGETLB (since Linux 2.6.32)
          Allocate the mapping using "huge" pages. See the Linux
          kernel source file
          Documentation/ad‐min-guide/mm/hugetlbpage.rst for further
          information, as well as NOTES, below.

   MAP_HUGE_2MB
   MAP_HUGE_1GB (since Linux 3.8)
          Used in conjunction with MAP_HUGETLB to select
          alternative hugetlb page sizes (respectively, 2 MB and 1
          GB) on systems that support multiple hugetlb page sizes.

Did you try those flags?