[PATCH RFC 0/7] selftests/sched: Add comprehensive SCHED_DEADLINE test suite
From: Juri Lelli
Date: Fri Mar 06 2026 - 11:13:28 EST
This series introduces a comprehensive test suite for the SCHED_DEADLINE
scheduler, providing coverage for core functionality, bandwidth admission
control, and the fair_server (dl-server) mechanism.
I've been playing with/using this set of tests for a while and they
helped me a little checking for regressions and corner cases. So, I
guess I've also now found the courage to share this with everyone and
see what happens. :P
Motivation
----------
SCHED_DEADLINE currently lacks dedicated test coverage in kselftest.
While the scheduler itself is well-tested in production, having automated
tests helps catch regressions during development and provides examples of
correct SCHED_DEADLINE usage for developers.
Development Process
-------------------
This series was developed using Claude Code (claude.ai/code), making it
both a testing improvement and an experiment in itself. The goal is to
explore what AI-assisted development can contribute to kernel testing
efforts - from framework design to test implementation to documentation.
All code has been reviewed and validated by the human maintainer, but the
bulk of the implementation, test design, and even this cover letter were
produced through iterative collaboration with Claude. This represents an
experiment in whether AI tools can help scale testing efforts while
maintaining code quality and kernel development standards.
Feedback on both the test suite itself and this development approach is
welcome.
Design
------
The test framework follows the pattern established by sched_ext selftests,
using ELF constructors for automatic test registration. This allows tests
to be self-contained and easily extensible - new tests are added simply by
defining a struct dl_test and calling REGISTER_DL_TEST().
The suite includes a utility library (dl_util) that provides reusable
helpers for common operations: setting SCHED_DEADLINE parameters, managing
bandwidth, controlling CPU topology, and process management.
Series Overview
---------------
Patch 1: Framework infrastructure with test discovery and structured output
Patch 2: Utility library and cpuhog helper program
Patch 3: Integration with kselftest build system
Patch 4: Basic functionality tests (scheduling, parameter validation)
Patch 5: Bandwidth admission control tests
Patch 6: fair_server (dl-server) tests
Patch 7: Regression test for ENQUEUE_REPLENISH bug
Testing
-------
All tests pass on x86_64 with both VM and bare-metal systems. The tests
adapt automatically to system configuration, detecting available bandwidth
and dl-server bandwidth allocations dynamically.
Tests can be run via:
make -C tools/testing/selftests TARGETS=sched run_tests
make -C tools/testing/selftests/sched/deadline run_tests
Or selectively:
cd tools/testing/selftests/sched/deadline
make
./runner -h
Current test results:
PASSED: 7
SKIPPED: 0
FAILED: 0
Series also available at
git@xxxxxxxxxx:jlelli/linux.git deadline-kselftests-rfc
Signed-off-by: Juri Lelli <juri.lelli@xxxxxxxxxx>
---
Juri Lelli (7):
selftests/sched: Add SCHED_DEADLINE test framework infrastructure
selftests/sched: Add SCHED_DEADLINE utility library
selftests/sched: Integrate SCHED_DEADLINE tests into kselftest framework
selftests/sched: Add basic SCHED_DEADLINE functionality tests
selftests/sched: Add SCHED_DEADLINE bandwidth tests to kselftest
selftests/sched: Add SCHED_DEADLINE fair_server tests to kselftest
selftests/sched: Add SCHED_DEADLINE ENQUEUE_REPLENISH bug test
tools/testing/selftests/sched/Makefile | 8 +
tools/testing/selftests/sched/deadline/.gitignore | 3 +
tools/testing/selftests/sched/deadline/Makefile | 54 +++
tools/testing/selftests/sched/deadline/bandwidth.c | 270 +++++++++++
tools/testing/selftests/sched/deadline/basic.c | 127 +++++
tools/testing/selftests/sched/deadline/cpuhog.c | 107 +++++
tools/testing/selftests/sched/deadline/dl_test.h | 238 +++++++++
tools/testing/selftests/sched/deadline/dl_util.c | 530 +++++++++++++++++++++
tools/testing/selftests/sched/deadline/dl_util.h | 294 ++++++++++++
.../testing/selftests/sched/deadline/fair_server.c | 260 ++++++++++
.../selftests/sched/deadline/replenish_bug.c | 337 +++++++++++++
tools/testing/selftests/sched/deadline/runner.c | 219 +++++++++
12 files changed, 2447 insertions(+)
---
base-commit: d658686a1331db3bb108ca079d76deb3208ed949
change-id: 20260306-upstream-deadline-kselftests-f7357ae20166
Best regards,
--
Juri Lelli <juri.lelli@xxxxxxxxxx>