Re: [PATCH RFC 4/7] selftests/sched: Add basic SCHED_DEADLINE functionality tests
From: Juri Lelli
Date: Mon Mar 09 2026 - 05:12:05 EST
On 09/03/26 09:15, Gabriele Monaco wrote:
> Hello,
>
> On Fri, 2026-03-06 at 17:10 +0100, Juri Lelli wrote:
> > Add initial test coverage for SCHED_DEADLINE scheduler functionality.
> > This patch introduces two fundamental tests that validate core
> > SCHED_DEADLINE behavior using the test framework and utility library.
> >
> > The basic_scheduling test creates a cpuhog process with SCHED_DEADLINE
> > policy and verifies the scheduling policy is correctly set to policy 6
> > (SCHED_DEADLINE). It confirms the task executes successfully for the
> > specified duration using reasonable parameters with 30ms runtime, 100ms
> > deadline, and 100ms period. This validates the fundamental operation of
> > setting SCHED_DEADLINE policy and running deadline-scheduled tasks.
> >
> > The parameter_validation test ensures the kernel properly validates
> > SCHED_DEADLINE parameters. It tests that invalid parameter combinations
> > such as runtime greater than deadline are correctly rejected with
> > EINVAL, while valid parameter configurations are accepted. This confirms
> > the kernel's parameter validation logic is working correctly and
> > prevents misconfigured deadline tasks from being scheduled.
> >
> > Both tests use the dl_util library for SCHED_DEADLINE operations and
> > follow the framework pattern with automatic registration via
> > REGISTER_DL_TEST(). The tests pass cleanly in VM environments with 2
> > tests passing, 0 skipped, and 0 failed.
> >
> > Assisted-by: Claude Code: claude-sonnet-4-5@20250929
> > Signed-off-by: Juri Lelli <juri.lelli@xxxxxxxxxx>
> > ---
> ...
> >
> > +# Test files
> > +$(OUTPUT)/basic.o: basic.c dl_test.h dl_util.h | $(OUTPUT_DIR)
> > + $(CC) $(CFLAGS) -c $< -o $@
> > +
>
> This seems a constant in all tests, what about just having make do the trick:
>
> $(OUTPUT)/%.o: %.c dl_test.h dl_util.h | $(OUTPUT_DIR)
> $(CC) $(CFLAGS) -c $< -o $@
That should work, thanks!
> The rest looks neat.
Cool. Thanks again for reviewing.
Best,
Juri