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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ba2c89bd-88de-48f8-abd0-b62d8b1d50b3@lucifer.local>
Date: Mon, 30 Jun 2025 11:54:36 +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

+cc Vlastimil, please keep him cc'd on discussions here as the author of this
fix in the conversation.

On Mon, Jun 30, 2025 at 10:55:52AM +0530, Dev Jain wrote:
>
>
> For this workload, do you enable mTHPs on your system? My plan is to make a
> similar patch for
>
> the mTHP case and I'd be grateful if you can get me some results : )

I'd urge caution here.

The reason there was a big perf improvement is that, for certain workloads, the
original patch by Rik caused issues with VMA fragmentation. So rather than
getting adjacent VMAs that might later be khugepage'd, you'd get a bunch of VMAs
that were auto-aligned and thus fragmented from one another.

So while you got speed ups on some workloads, you got really bad perf impact on
some that were subject to this.

The observed speed up was on a very specific benchmark also. While it's a great
improvement, it's important to understand the context (see the original patch
for details [0]).

I do think it's worth considering changing thp_get_unmapped_area_vmflags() for
mTHP, as it's currently very limited (just PMD alignment) and it'd possibly be
sensible to change this to checking against allowed THP alignments, but I'd not
assume this is going to get some crazy speed up as observed here.

Note that any such change would probably require some refactoring in THP first
to make it not quite so awful.

I also think for Siddharta's usecase mTHP isn't really relevant is it, as intel
do not support mTHP currently do they?

Regards, Lorenzo

[0]: https://lore.kernel.org/all/20241024151228.101841-2-vbabka@suse.cz/T/#u

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ