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: <f746d3aa-17e7-4b42-9e08-97cdb2cad89b@lucifer.local>
Date: Tue, 1 Jul 2025 06:53:43 +0100
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Dev Jain <dev.jain@....com>
Cc: siddhartha@...ip.in, linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        mgorman@...e.de, Vlastimil Babka <vbabka@...e.cz>
Subject: Re: [PATCH] mm: limit THP alignment – performance gain observed in AI inference workloads

On Tue, Jul 01, 2025 at 11:15:25AM +0530, Dev Jain wrote:
> Sorry I am not following, don't know in detail about the VMA merge stuff.
> Are you saying the after the patch, the VMAs will eventually get merged?
> Is it possible in the kernel to get a merge in the "future"; as I understand
> it only happens at mmap() time?
>
> Suppose before the patch, you have two consecutive VMAs between (PMD, 2*PMD) size.
> If they are able to get merged after the patch, why won't they be merged before the patch,
> since the VMA characteristics are the same?
>
>

Rik's patch aligned each to 2 MiB boundary. So you'd get gaps:


  0            2MB                      4MB           6MB                      8MB          10MB
  |-------------.------|                 |-------------.------|                 |-------------.------|
  |             .      |		 |             .      |                 |             .      |
  |             .      |		 |             .      |                 |             .      |
  |-------------.------|		 |-------------.------|                 |-------------.------|
    huge mapped  4k m'd


If you don't force alignment then subsequent mappings will be adjacent to one
another and those non-huge page parts can be merged.

Vlasta's fix up means we only try to get the THP up-front if the length is
already aligned at which point you won't end up with these gaps.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ