Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH RFC 0/7] selftests/sched: Add comprehensive SCHED_DEADLINE test suite
@ 2026-03-06 16:10 Juri Lelli
  2026-03-06 16:10 ` [PATCH RFC 1/7] selftests/sched: Add SCHED_DEADLINE test framework infrastructure Juri Lelli
                   ` (6 more replies)
  0 siblings, 7 replies; 21+ messages in thread
From: Juri Lelli @ 2026-03-06 16:10 UTC (permalink / raw)
  To: Shuah Khan, Peter Zijlstra, Ingo Molnar
  Cc: Vincent Guittot, Dietmar Eggemann, Steven Rostedt,
	Valentin Schneider, Clark Williams, Gabriele Monaco,
	Tommaso Cucinotta, Luca Abeni, linux-kernel, linux-kselftest,
	Juri Lelli

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@github.com:jlelli/linux.git deadline-kselftests-rfc

Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
---
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@redhat.com>


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2026-03-12 14:13 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-06 16:10 [PATCH RFC 0/7] selftests/sched: Add comprehensive SCHED_DEADLINE test suite Juri Lelli
2026-03-06 16:10 ` [PATCH RFC 1/7] selftests/sched: Add SCHED_DEADLINE test framework infrastructure Juri Lelli
2026-03-09  8:20   ` Gabriele Monaco
2026-03-09  9:10     ` Juri Lelli
2026-03-06 16:10 ` [PATCH RFC 2/7] selftests/sched: Add SCHED_DEADLINE utility library Juri Lelli
2026-03-11  9:39   ` Christian Loehle
2026-03-11 13:15     ` Juri Lelli
2026-03-06 16:10 ` [PATCH RFC 3/7] selftests/sched: Integrate SCHED_DEADLINE tests into kselftest framework Juri Lelli
2026-03-06 16:10 ` [PATCH RFC 4/7] selftests/sched: Add basic SCHED_DEADLINE functionality tests Juri Lelli
2026-03-09  8:15   ` Gabriele Monaco
2026-03-09  9:11     ` Juri Lelli
2026-03-06 16:10 ` [PATCH RFC 5/7] selftests/sched: Add SCHED_DEADLINE bandwidth tests to kselftest Juri Lelli
2026-03-11  9:31   ` Christian Loehle
2026-03-11 13:23     ` Juri Lelli
2026-03-11 13:44       ` Christian Loehle
2026-03-11 14:26         ` Christian Loehle
2026-03-12 10:43           ` Christian Loehle
2026-03-12 11:30             ` Christian Loehle
2026-03-12 14:13               ` Juri Lelli
2026-03-06 16:10 ` [PATCH RFC 6/7] selftests/sched: Add SCHED_DEADLINE fair_server " Juri Lelli
2026-03-06 16:10 ` [PATCH RFC 7/7] selftests/sched: Add SCHED_DEADLINE ENQUEUE_REPLENISH bug test Juri Lelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox