From: Michal Hocko <mhocko@suse.com>
To: David Hildenbrand <david@redhat.com>
Cc: Zi Yan <ziy@nvidia.com>,
Anshuman Khandual <anshuman.khandual@arm.com>,
Dev Jain <dev.jain@arm.com>, Wei Yang <richard.weiyang@gmail.com>,
akpm@linux-foundation.org, vbabka@suse.cz, surenb@google.com,
jackmanb@google.com, hannes@cmpxchg.org, linux-mm@kvack.org,
Oscar Salvador <osalvador@suse.de>
Subject: Re: [PATCH] mm/page_alloc: fix alignment for alloc_contig_pages_noprof()
Date: Thu, 25 Sep 2025 11:50:04 +0200 [thread overview]
Message-ID: <aNUQTDkcbvImdMgP@tiehlicka> (raw)
In-Reply-To: <d2f51ba5-1f3e-4a72-89ab-23a11059d971@redhat.com>
On Thu 25-09-25 11:22:26, David Hildenbrand wrote:
> On 25.09.25 10:14, Michal Hocko wrote:
> > On Wed 24-09-25 14:19:37, David Hildenbrand wrote:
> > > On 24.09.25 14:01, Michal Hocko wrote:
> > [...]
> > > > I thought we have concluded that there is no user expecting a specific
> > > > alignment. Or have I misunderstood that?
> > >
> > > We concluded that for users that don't pass in non-power-2 requests.
> >
> > Ok, my misreading of the discussion then.
> >
> > > hugetlb->folio_alloc_gigantic()->alloc_contig_pages_noprof() certainly
> > > expects a suitable alignment :)
> >
> > True that.
> >
> > So effectivelly there is nothing to be done here right. Those that
> > provide power-two requests will get what they have been getting and
> > those non-existent others
>
> I think kfence might be doing a non-power-of-two allocation. TDX maybe as
> well.
>
> But neither seems to depend on some alignment, so all good.
>
> > will get whatever as we do not provide any
> > guarantee in that case. Maybe something we could add as a comment.
>
> We currently have
>
> "The allocated memory is always aligned to a page boundary. If nr_pages is a
> power of two, then allocated range is also guaranteed to be aligned to same
> nr_pages (e.g. 1GB request would be aligned to 1GB)."
>
> What would be your suggestion?
Suggestion to self to read through the doc before suggesting editings
and suggestion to the patch to not do anything.
Thanks for the patience with me.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2025-09-25 9:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 0:19 Wei Yang
2025-09-23 1:46 ` Zi Yan
2025-09-23 7:06 ` Anshuman Khandual
2025-09-23 7:48 ` David Hildenbrand
2025-09-23 15:07 ` Zi Yan
2025-09-24 11:32 ` Michal Hocko
2025-09-24 11:40 ` David Hildenbrand
2025-09-24 12:01 ` Michal Hocko
2025-09-24 12:19 ` David Hildenbrand
2025-09-25 8:14 ` Michal Hocko
2025-09-25 9:22 ` David Hildenbrand
2025-09-25 9:50 ` Michal Hocko [this message]
2025-09-23 6:47 ` Dev Jain
2025-09-23 15:05 ` Zi Yan
2025-09-23 7:29 ` Michal Hocko
2025-09-24 0:05 ` Wei Yang
2025-09-24 11:31 ` Michal Hocko
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=aNUQTDkcbvImdMgP@tiehlicka \
--to=mhocko@suse.com \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=david@redhat.com \
--cc=dev.jain@arm.com \
--cc=hannes@cmpxchg.org \
--cc=jackmanb@google.com \
--cc=linux-mm@kvack.org \
--cc=osalvador@suse.de \
--cc=richard.weiyang@gmail.com \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=ziy@nvidia.com \
/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