Re: [GIT PULL] Kernel API specification framework for v7.4
From: Linus Torvalds
Date: Mon Nov 16 2026 - 14:36:58 EST
On Mon, 16 Nov 2026 at 10:14, Sasha Levin <levinsasha928@xxxxxxxxx> wrote:
>
> Ping?
So honestly, I really don't like it. I don't think *any* of this
should be inside the kernel. I don't think the in-kernel side helps at
all: the comments are too big, nobody will read them, and the whole -
and only - real use of them would be outside validation, not at
run-time.
IOW, I see only downsides to polluting the kernel source code with
comments that aren't useful to humans.
If this was a spec that is maintained in some automated format - not
in C comments in source files that aren't useful as comments anyway
purely inside something like tools/kernel-api/ (or Documentation, or
even an outside repository entirely), together with the scripts to
then validate it, that would be one thing.
But polluting source code with huge comments that aren't for humans is
right out. Particularly when it clearly is a "first step" and the
intent is to make those comments bigger and more extended in the
future.
And I see *no* upside to any /sys/kernel/debug/kapi interface. Nobody
cares, and any excuse to make it dynamic ("We might update the API in
the future") is actually the complete opposite of the whole point of a
stable API and not something I want to make easier or support in any
way what-so-ever.
So all of the in-kernel side to me looks like actively detrimental to
the whole idea.
What I think *can* work is an external spec that is written so that
tools (read: AI) can actually then verify it against kernel sources,
and that can be used to also drive automated testing. But putting any
of it inside the kernel is bad.
Linus