Subject: Re: [REGRESSION] rseq: refactoring in v6.19 broke everyone on arm64 and tcmalloc everywhere

From: Thomas Gleixner <[email-masked]>
Date: Tue, 28 Apr 2026 10:51:29 +0200

On Tue, Apr 28 2026 at 09:39, Peter Zijlstra wrote:
> On Mon, Apr 27, 2026 at 12:04:48AM +0200, Thomas Gleixner wrote:
>>  static inline void rseq_signal_deliver(struct ksignal *ksig, struct pt_regs *regs)
>>  {
>> -	if (IS_ENABLED(CONFIG_GENERIC_IRQ_ENTRY)) {
>> +	if (IS_ENABLED(CONFIG_GENERIC_IRQ_ENTRY) && rseq_optimized(current)) {
>
> rseq_optimized() already implies GENERIC_IRQ_ENTRY

Indeed.

>> +			u8			optimized;
>>  			union {
>>  				u16		error;
>>  				struct {
>
> I know you like the 'optimized' name, it is faster etc. However, the
> description there suggests: has_rseq_v2 not be a bad name.
>
> And while I write this, I figured we could have the value of has_rseq be
> 2, rather than 1, but this might end up generating worse code, dunno,
> haven't tried yet.

Tried that early on and it was worse, but back the approach has changed
since then and I just validated that it's actually fine to do so. Fixed.

Thanks,

        tglx