mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Oscar Salvador <osalvador@suse.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	Borislav Petkov <bp@alien8.de>,
	Karsten Desler <kdesler@soohrt.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] arch,x86: Skip setting align_offset for hugetlb mappings
Date: Mon, 1 Jun 2026 13:02:59 -0700	[thread overview]
Message-ID: <20260601130259.08e03bd738cf40dfcd9744d5@linux-foundation.org> (raw)
In-Reply-To: <20260601125015.216110-1-osalvador@suse.de>

On Mon,  1 Jun 2026 14:50:15 +0200 Oscar Salvador <osalvador@suse.de> wrote:

> On x86, arch_get_unmapped_area{_topdown} set align_offset in order to avoid
> cache aliasing on I$ on AMD family 15h when 'align_va_addr' is enabled.
> Prior to commit 7bd3f1e1a9ae ("mm: make hugetlb mappings go through mm_get_unmapped_area_vmflags"),
> we did not have to worry about that because hugetlb specific code did not set
> align_offset, but above commit got rid of hugetlb specific code and started to route
> hugetlb mappings through the generic interface.
> Doing that has the effect of handling non-aligned hugetlb mappings to userspace,
> which is plain wrong.
> 
> So, skip setting align_offset if we are dealing with a hugetlb mapping.

Cool.

> Fixes: 7bd3f1e1a9ae ("mm: make hugetlb mappings go through mm_get_unmapped_area_vmflags")
> Reported-by: Karsten Desler <kdesler@soohrt.org>
> Closes: https://lore.kernel.org/linux-mm/20260527143643.GO31091@soohrt.org/

Ah, there it is.  "the kernel later BUGs".  We'd prefer it not do that so I'll cc:stable.

Thanks for including the link.  And thanks Karsten for reporting and
testing.

> So, let me say two things:
> 1) Karsten tested below patch and reported it was working fine for him.
>    Did not stamp his Tested-by though, because it was not explicitly provided.

This often happens - testers (well, confirmers) don't formally add the
tag.  Often these people aren't regular kernel developers and simply
don't know the conventions.  But if I see that email, I'll add the
Tested-by: because that's what happened.

> 2) This is a hack, I know, and I should probably be flagellated for this but
>    since this is a regression, I went for the quick/easy-to-apply fix, so it can
>    be easily backported.

That works (the patch, not the flagellation).

>    Having said that, I already made my mind to fix this in a better way, which would
>    involve getting rid of hugetlb-specific code and do the masking off as we do for
>    THP, but for that I need to refactor the code and that would not be so easy
>    to backported. Just so you understand the reasoning behind.

Great, thanks, flagellation is excused.



  reply	other threads:[~2026-06-01 20:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-01 12:50 Oscar Salvador
2026-06-01 20:02 ` Andrew Morton [this message]
2026-06-01 20:25 ` Dave Hansen
2026-06-02  5:02   ` Oscar Salvador (SUSE)
2026-06-02 13:26     ` Oscar Salvador (SUSE)
2026-06-04 14:51   ` Oscar Salvador (SUSE)
2026-06-04 20:38     ` Dave Hansen

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=20260601130259.08e03bd738cf40dfcd9744d5@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=kdesler@soohrt.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=osalvador@suse.de \
    /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

Powered by JetHome