Re: [PATCH] arch,x86: Skip setting align_offset for hugetlb mappings
From: Dave Hansen
Date: Mon Jun 01 2026 - 16:25:37 EST
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.
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.
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.
Second, if there's a hack to be had, it should probably be to back out
the AMD optimization. That's absolutely an x86-only thing.
Third, I have zero issues with distros adding and carrying the x86
align_offset hack. That's what kernel distros are *for*.