linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Dev Jain <dev.jain@arm.com>
Cc: siddhartha@kenip.in, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, mgorman@suse.de,
	Vlastimil Babka <vbabka@suse.cz>
Subject: Re: [PATCH] mm: limit THP alignment – performance gain observed in AI inference workloads
Date: Tue, 1 Jul 2025 06:28:55 +0100	[thread overview]
Message-ID: <ee92d6a9-529a-4ac5-b3d0-0ff4e9085786@lucifer.local> (raw)
In-Reply-To: <5816677a-705e-4a8f-b598-d74ff6198a02@arm.com>

On Tue, Jul 01, 2025 at 10:53:09AM +0530, Dev Jain wrote:
>
> On 30/06/25 4:24 pm, Lorenzo Stoakes wrote:
> > +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.
>
> How does getting two different adjacent VMAs allow them to be khugepage'd if
> both are less than PMD size? khugepaged operates per vma, I'm missing something.

(future) VMA merge

Consider allocations that are >PMD but < 2*PMD for instance. Now you get
fragmentation. For some workloads you would have previously eventually got PMD
leaf mapping, PMD leaf mapping, PMD leaf mapping, etc. contiguouosly, with this
arragenement you get PMD mapping, <bunch of PTE mappings>, PMD mapping, etc.


  reply	other threads:[~2025-07-01  5:29 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-27 10:39 siddhartha
2025-06-27 10:45 ` siddhartha
2025-06-27 15:30 ` Lorenzo Stoakes
2025-06-28  3:49   ` Dev Jain
2025-06-30  0:43     ` siddhartha
2025-06-30  5:25       ` Dev Jain
2025-06-30  5:28         ` Dev Jain
2025-06-30 10:54         ` Lorenzo Stoakes
2025-06-30 11:48           ` siddhartha
2025-07-01  5:23           ` Dev Jain
2025-07-01  5:28             ` Lorenzo Stoakes [this message]
2025-07-01  5:45               ` Dev Jain
2025-07-01  5:53                 ` Lorenzo Stoakes
2025-07-01  6:30                   ` Dev Jain
2025-07-01  6:50                     ` Lorenzo Stoakes
2025-07-01  6:58                       ` Dev Jain
2025-07-01 12:15                         ` siddhartha
2025-07-01 12:39                           ` Lorenzo Stoakes
2025-07-01 13:23                             ` siddhartha
2025-07-01 13:28                               ` Lorenzo Stoakes
2025-07-01 14:20                                 ` siddhartha
2025-07-01 16:20                             ` Dev Jain
2025-07-01 18:49                               ` Zi Yan
2025-07-07  8:56                                 ` Vlastimil Babka
2025-07-28  5:41                                   ` siddhartha
2025-07-28 11:00                                     ` Vlastimil Babka
2025-07-01 15:40                           ` Yang Shi
2025-08-11 22:14 siddhartha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee92d6a9-529a-4ac5-b3d0-0ff4e9085786@lucifer.local \
    --to=lorenzo.stoakes@oracle.com \
    --cc=dev.jain@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=siddhartha@kenip.in \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox