Re: [PATCH v2 4/5] selftests/futex: Test priority inheritance on PI futexes

From: Mathieu Desnoyers

Date: Mon Nov 16 2026 - 13:48:19 EST


Hi Sebastian,

> Reviewed-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>

Thanks. I will add your tag in the next version.

> This breaks if your timeout is something like 1.5s and ts.nsec is
> already > 0.5s. We usually do
> | while (ts->tv_nsec >= NSEC_PER_SEC) {

The whole seconds of the timeout go to tv_sec first, so only the part
below one second is added to tv_nsec. The sum stays below two seconds,
and one subtraction is enough. I will still use the while loop, since
it is the usual form.

> Could rename it to start_pi_thread() or pi_start_thread() rather than
> just start?

Yes: start_pi_thread() in the next version.

> I can't imagine why one would set a stack size 64KiB here. It
> shouldn't matter.

It is for the max_lock_depth case. It starts max_lock_depth + 2
threads, 1026 with the default. Small stacks keep that cheap. I will
add a comment that says so.

Thanks,

Mathieu


--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com