mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Oscar Salvador (SUSE)" <osalvador@kernel.org>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Oscar Salvador <osalvador@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	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: Tue, 2 Jun 2026 07:02:22 +0200	[thread overview]
Message-ID: <ah5j3hYpBN4Esl8h@localhost.localdomain> (raw)
In-Reply-To: <53b599ef-0f16-44d9-bfda-a5a751649193@intel.com>

On Mon, Jun 01, 2026 at 01:25:12PM -0700, Dave Hansen wrote:
> On 6/1/26 05:50, Oscar Salvador 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.
> 
> I'm sorry, but this is a big NAK from the x86 side, without at _least_ a
> substantially improved changelog and evidence that x86 is both the only
> place to reasonably fix this _and_ evidence that no other arch is affected.
> 
> Why?
> 
> x86 is not the only architecture that uses .align_offset.

Yes, although we skip setting it for hugetlb mappings already some other
arches like sparc and s390.

> The bug was introduced in a generic, non-x86 commit (7bd3f1e1a9ae)
> 
> The real fix is almost surely in arch-generic code.
> 
> So my fear is that we'll apply the x86 thing. Four other architectures
> will come along and have to add their own fixes. Then (if we're lucky)
> someone will stick around and fix it properly, than all the
> architectures will have to remove their hacks.

Yes, I am not happy either with the current code, given that some arches have
to do this dance of skip-offset-if-hugetlb and feels _quite_ wrong to do
it at arch level, given that only hugetlb needs that and given that
hugetlb is not the only one needing aligned things (thp?).

> Worst-case, we end up with a latent bug, just without any testing
> coverage because x86 testing is the most broad.
> 
> Oscar, even if the real fix involves a couple of patches, can we please
> see that, first? Then, we can go back and make an informed decision
> about hacks versus proper fixes.

Sure, as I already said I was not happy with the fix either, was just an
attempt to address the regression quicker.
Having said that, and proven that you are not happy either, let me take
the long(er) road and come up with a proper fix for everyone, so no more
hacks on arch level are needed.


-- 
Oscar Salvador
SUSE Labs

  reply	other threads:[~2026-06-02  5:02 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
2026-06-01 20:25 ` Dave Hansen
2026-06-02  5:02   ` Oscar Salvador (SUSE) [this message]
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=ah5j3hYpBN4Esl8h@localhost.localdomain \
    --to=osalvador@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --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

all inboxes | Powered by JetHome®