[LTP] sched_setattr: Convert to new API
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Fri Sep 11 19:51:11 CEST 2026
Hi Andrea,
On Fri, 11 Sep 2026 15:14:34 +0200, Andrea Cervesato wrote:
> sched_setattr: Convert to new API
--- [PATCH 1/5] ---
> + if (sched_getattr(0, &read_attr, sizeof(read_attr), 0) == -1) {
> + tst_res(TFAIL | TERRNO, "sched_getattr() failed");
> + return;
> + }
Returning early with tst_res() skips reset_sched(), leaving the process in
SCHED_DEADLINE for subsequent iterations (-i). Use tst_brk(TBROK | TERRNO,
"sched_getattr() failed") so that cleanup is triggered on failure.
--- [PATCH 2/5] ---
> + TST_EXP_PASS(sched_getattr(0, read_attr, sizeof(*read_attr), 0),
> + "sched_getattr() with valid parameters");
> + if (!TST_PASS)
> + return;
Returning early on failure skips reset_sched() at the end of run(),
leaving the process in SCHED_DEADLINE for subsequent iterations (-i).
Call reset_sched() before returning.
--- [PATCH 3/5] ---
> diff --git a/include/lapi/sched.h b/include/lapi/sched.h
This commit should be placed before patches 1 and 2 in the series so
that those tests can use SAFE_SCHED_SETATTR() directly upon conversion.
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
More information about the ltp
mailing list