Re: [patch 8/8] x86/vdso: Implement __vdso_futex_robust_try_unlock()

From: Thomas Gleixner

Date: Thu Mar 19 2026 - 03:10:57 EST


On Wed, Mar 18 2026 at 23:05, André Almeida wrote:
> Em 18/03/2026 19:08, Thomas Gleixner escreveu:
>>
>> 2) Make that mixed size mode depend on a config option
>>
>> 3) Require that such a use case issues a prctl to switch into that
>> special case mode.
>>
>> or a combination of those.
>>
>> Andre?
>>
>
> Those two last options works for me, if it helps to make the code more
> readable. However, I think that QEMU might be interested in those
> features as well :) I'm going to ping them

I already came up with something. It makes the fixup range larger as it
has to cover two functions and then pick the right one.

So the range check becomes:

if (likely(!ip_within(regs, mm->futex.cs_start, mm->futex.cs_end)))
return;

if (likely(!mm->futex.cs_multi)) {
fixup(regs, NULL);
return;
}

csr = mm->futex.cs_ranges;
for (range = 0; range < mm->futex.cs_multi; range++, csr++) {
if (ip_within(regs, csr->cs_start, csr->cs_end)) {
fixup(regs, csr);
return;
}
}

Or something daft like that.

That makes the multi CS range check generic and still optimizes for the
single entry case. The ASM functions become minimal w/o extra pointer
size conditionals.

Thanks,

tglx