Skip to content

Trim kernel/sched via debug.c and deadline.c gates#12

Merged
jserv merged 1 commit intomainfrom
sched
May 1, 2026
Merged

Trim kernel/sched via debug.c and deadline.c gates#12
jserv merged 1 commit intomainfrom
sched

Conversation

@jserv
Copy link
Copy Markdown
Owner

@jserv jserv commented May 1, 2026

Linux 7.0 unified deadline.c into build_policy.c and debug.c into build_utility.c, deleting the historical CONFIG_SCHED_DEADLINE and CONFIG_SCHED_DEBUG knobs. On a NOMMU image with no /proc//sched reader, no debugfs sched-domain consumer, no sysrq input device, and no SCHED_DEADLINE userspace, the two files are ~14.8KB of dead .text that no Kconfig flip can reach.

Reintroduce the gates as out-of-tree patches: SCHED_DEBUG_OUTPUT and SCHED_DEADLINE_CLASS, both default y. When n, each file's body is wrapped in #ifdef and a stub block at the same path provides empty implementations of every externally-called symbol. Stub dl_sched_class is registered via DEFINE_SCHED_CLASS(dl) so it lands in the __dl_sched_class linker section between stop and rt; the C99 sparse initializer still reserves the full 116-byte struct, zero-filling every callback except .pick_task (which returns NULL so the chain walk falls through to fair). __checkparam_dl returns false so sched_setattr with policy=6 fails admission and no task ever joins the class.

Build.sh disables the new symbols and a small cluster of dependent knobs (CGROUPS, PSI, SCHED_AUTOGROUP) that share the same audience on a single-rootfs UP target. The post-olddefconfig verifier covers both new symbols positively and the cgroup/SMP-dependent siblings negatively, so a future Kconfig drift that flips any of them back to =y aborts the build loudly instead of silently regressing the image.

Measured: vmlinux .text -18,240 (-2.4%), .rodata -1,920 (-1.6%), linux.axf 1,229,344 -> 1,212,960 (-16,384 / -1.33%). QEMU MPS2-AN386 boots clean to BusyBox shell, dmesg has no warn/bug/oops/null.

Linux 7.0 unified deadline.c into build_policy.c and debug.c into
build_utility.c, deleting the historical CONFIG_SCHED_DEADLINE and
CONFIG_SCHED_DEBUG knobs.  On a NOMMU image with no /proc/<pid>/sched
reader, no debugfs sched-domain consumer, no sysrq input device, and
no SCHED_DEADLINE userspace, the two files are ~14.8KB of dead .text
that no Kconfig flip can reach.

Reintroduce the gates as out-of-tree patches: SCHED_DEBUG_OUTPUT and
SCHED_DEADLINE_CLASS, both default y.  When n, each file's body is
wrapped in #ifdef and a stub block at the same path provides empty
implementations of every externally-called symbol.  Stub dl_sched_class
is registered via DEFINE_SCHED_CLASS(dl) so it lands in the
__dl_sched_class linker section between stop and rt; the C99 sparse
initializer still reserves the full 116-byte struct, zero-filling every
callback except .pick_task (which returns NULL so the chain walk falls
through to fair).  __checkparam_dl returns false so sched_setattr with
policy=6 fails admission and no task ever joins the class.

Build.sh disables the new symbols and a small cluster of dependent
knobs (CGROUPS, PSI, SCHED_AUTOGROUP) that share the same audience
on a single-rootfs UP target.  The post-olddefconfig verifier covers
both new symbols positively and the cgroup/SMP-dependent siblings
negatively, so a future Kconfig drift that flips any of them back to
=y aborts the build loudly instead of silently regressing the image.

Measured: vmlinux .text -18,240 (-2.4%), .rodata -1,920 (-1.6%),
linux.axf 1,229,344 -> 1,212,960 (-16,384 / -1.33%).  QEMU MPS2-AN386
boots clean to BusyBox shell, dmesg has no warn/bug/oops/null.

The canonical mirror at downloads.uclibc-ng.org has been returning
HTTP 522 (Cloudflare-to-origin failure) for extended windows, breaking
CI on a fresh downloads cache (wget exits 8, no useful diagnostic
under QUIET=1).  GitHub's tag-based source archive is permanent for a
fixed (repo, tag) pair and contains the same 5,527-file tree as the
upstream release tarball -- verified by extracting both and comparing
the concat-and-hash of all file contents.
@jserv jserv merged commit 10a3975 into main May 1, 2026
2 checks passed
@jserv jserv deleted the sched branch May 1, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant