Re: Follow-up on Linux-kernel code accessibility
From: Chris Mason
Date: Fri Dec 19 2025 - 16:06:12 EST
On 12/19/25 12:09 PM, Theodore Tso wrote:
> On Fri, Dec 19, 2025 at 07:51:47AM +0100, Julia Lawall wrote:
>>
>> Maybe we're not looking for an instant understanding methodology. Rather
>> a machine checkable way to document the invariants that exist in the head
>> of the developer, and for some bounded amount of time in the head of the
>> person who has tried to reconstruct them.
>
> One of the things that I found really interesting with Chris Mason's
> kernel review prompts is that it documents some of these invariants
> which are not otherwise covered in the kernel documentation. And
> while Chris originally created those prompts for Anthropic's Claude
> LLM, we've successfully used them with Gemini 2.5 and 3.
>
> I wonder if we should consider folding them into the kernel sources,
> so they can be updated alongside the kernel. It might also mean that
> as the invariants change, the documentation / prompts in an LTS kernel
> and for the latest upstream kernel can be up to sync with the relevant
> kernel versions.
>
Yeah, I agree. I think/hope these details from the prompts can end up
folded into the kernel docs. As the prompts age, we're going to have
the equivalent of sprinkling ifdefs into them, and I think it's much
better if they just reference knowledge in the kernel.
I recently pushed out changes that remove most of the process and focus
more on kernel internals. So hopefully over time we can get to
something that just documents kerneling in a way that is useful beyond
LLMs.
-chris