Re: [linus:master] [atomic] 80047d84ee: WARNING:at_include/linux/instrumented.h:#__split_huge_pmd_locked
From: Dave Hansen
Date: Tue Nov 03 2026 - 12:02:48 EST
On 11/3/26 07:43, Andrew Morton wrote:
>> +typedef u64 __aligned(8) pteval_t;
>> +typedef u64 __aligned(8) pmdval_t;
>> +typedef u64 __aligned(8) pudval_t;
>> +typedef u64 __aligned(8) p4dval_t;
>> +typedef u64 __aligned(8) pgdval_t;
>> +typedef u64 __aligned(8) pgprotval_t;
>>
> (cc Dave)
>
> fwiw this was discussed a couple of years ago but nothing really came
> of it.
>
> https://lore.kernel.org/20240401185451.6897208962d3fc47a12ffb5a@xxxxxxxx
Heh, same code. Same basic problem. Two different detectors firing.
But I also kinda feel like shooting the messenger on this one. The
warnings are presumably to help us with performance problems. This is
old, legacy code that nobody cares about running fast. So they're not
actually helpful here. I don't think it's the craziest thing, at least
on x86_32, to just turn the warnings off.
Also, if there are plans to get all the pmd_t's off the stack, maybe we
should just manually align them for now. It wouldn't hurt to make the
definitions uglier like:
#define pxx_xchg64(_pxx, _ptr, _val) ({
_pxx##val_t *_p = (_pxx##val_t *)_ptr;
- _pxx##val_t _o = *_p;
+ _pxx##val_t _o __aligned(sizeof(_pxx##val_t)) = *_p;
do { } while (!try_cmpxchg64(_p, &_o, (_val)));
native_make_##_pxx(_o);
})
or
static int vmemmap_split_pmd(pmd_t *pmd, struct page *head, ...
{
- pmd_t __pmd;
+ pmd_t __pmd __aligned(sizeof(pmd_t));