Re: [PATCH v7 38/40] selftests/sched: Add a test of SCHED_DEADLINE policy round trips

From: Mathieu Desnoyers

Date: Wed Nov 18 2026 - 08:43:47 EST


> Does pthread_attr_setstacksize(&fa, FILLER_STACK) fail with EINVAL on
> architectures where PTHREAD_STACK_MIN is larger than 64 KiB, such as
> arm64 and powerpc64 (128 KiB)?

Yes, thanks. The case then fails in its setup on those architectures.
deadline_bw_test.c raises its stack to PTHREAD_STACK_MIN. This test
missed it. The next version raises FILLER_STACK the same way.

> Also, pthread_attr_init() and pthread_attr_setstacksize() return an
> error number directly without setting errno, so strerror(errno)
> reports a stale errno (typically "Success"), and this error path
> returns without closing filler_pipe or destroying fa.

Right. The next version splits the setup, so each step prints its own
error. It prints the error number that pthread_attr_*() return. The
error paths now free what the setup made.

> Should test_sysrq_boosted_owner() and test_sysrq_running_owner() call
> sem_destroy() on owner_locked, owner_go, filler_ready, and waiter_go
> during cleanup?

Yes. No thread uses owner_locked when the second case initializes it
again, so it is harmless in practice. But POSIX leaves it undefined. The
next version destroys the semaphores at the end of both cases.

Both points were checked by reading.

Thanks,

Mathieu

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