ksummit.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <clm@meta.com>
To: Sasha Levin <sashal@kernel.org>
Cc: ksummit@lists.linux.dev, Dan Carpenter <dan.carpenter@linaro.org>,
	Alexei Starovoitov <ast@kernel.org>
Subject: Re: [MAINTAINERS / KERNEL SUMMIT] AI patch review tools
Date: Wed, 8 Oct 2025 21:43:48 -0400	[thread overview]
Message-ID: <796882a3-cb05-41a9-b7ca-8af49a05623f@meta.com> (raw)
In-Reply-To: <aOaujzH1dl-OEbsO@laps>

On 10/8/25 2:33 PM, Sasha Levin wrote:
> On Wed, Oct 08, 2025 at 01:04:54PM -0400, Chris Mason wrote:
>> Hi everyone,
>>
>> Depending on how you look at things, this is potentially a topic for
>> either MS or KS.
>>
>> One way to lower the load on maintainers is to make it easier for
>> contributors to send higher quality patches, and to catch errors before
>> they land in various git trees.
>>
>> Along those lines, when the AI code submission thread started over the
>> summer, I decided to see if it was possible to get reasonable code
>> reviews out of AI.
> 
> This is a really great subject to discuss.
> 
> IMO when the AI topic initially came up the concerns around AI drowned
> discussions of finding places where AI could be useful and provide
> support for
> maintainers struggling under the load.
> 
>> There are certainly false positives, but Alexei and the BPF developers
>> wired up my prompts into the BPF CI, and you can find the results in
>> their github CI.  Everything in red is a bug the AI review found:
>>
>> https://github.com/kernel-patches/bpf/actions/workflows/ai-code-
>> review.yml
>> My goal for KS/MS is to discuss how to enable maintainers to use review
>> automation tools to lower their workload.  I don't want to build new CI
>> here, so the goal would be enabling integration with existing CI.
> 
> This is great to see!
> 
> I think that AUTOSEL is already a large scale kernel patch review
> workflow and
> I'd love to work more towards a unified kernel patch AI review story that
> community members could use.
> 
> I've gotten good feedback[1] from Linus about the AI AUTOSEL workflow
> and his
> idea around expanding our AI tooling to help with maintainer workflows
> sounds
> in line with what you're describing here.

Fantastic.

> 
>> My question for everyone is what would it take to make all of this
>> useful?  I'm working on funding for API access, so hopefully that part
>> won't be a problem.
> 
> I've been playing with extending[2] b4 (unofficially) with AI workflows
> that
> are useful for myself. The patches themselves aren't too interesting,
> but what
> I found exciting is expanding b4 with tooling that maintainers can run
> locally
> and which will save them a good amound of time/effort.
> 
> Something along the lines of "b4 ai review [commit]" or "b4 ai style
> [patch]".

Yeah, I think that'll really help as well.

> 
>> There's definitely overlap between the bugs I'm finding and the bugs Dan
>> Carpenter finds, so I'm hoping he and I can team up as well.
>>
>> In terms of actual review details, the reviews have two parts:
>>
>> 1) The review prompts.  These are stand alone and can just work on any
>> kernel tree.  This is what BPF CI is currently using:
>>
>> https://github.com/masoncl/review-prompts/ 
> 
> I think I'll borrow some of these :)
> 
> It was interesting to read through some of the prompts and see where you
> had
> good and bad experience with the AI ("You're not smart enough to understand
> smp_mb()" :D )

If I'm being honest, I'm probably not smart enough to teach AI about
smp_mb(), but that's a different problem.

> 
>> These prompts can also debug oopsen or syzbot reports (with varying
>> success).
>>
>> 2) A code indexing tool with MCP server that Claude can use to find
>> functions, types, and call chains more effectively.  This makes it more
>> likely Claude can trace complex relationships in the code:
>>
>> https://github.com/facebookexperimental/semcode
>> Asking claude to produce a callgraph for btrfs_search_slot() consumes
>> ~444K tokens.  With semcode installed, the same query produces better
>> results and uses 25K tokens. (btrfs_search_slot() has a huge callchain)
> 
> Also very interesting! AUTOSEL is a token eating machine. Reducing token
> counts
> while still getting the same (or better) quality of outputs is really
> great.

I think/hope the extra context will make a huge difference, and I want
to add indexing for git history and lore archives as well.

-chris


  reply	other threads:[~2025-10-09  1:44 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-08 17:04 Chris Mason
2025-10-08 17:20 ` Konstantin Ryabitsev
2025-10-08 18:11   ` Sasha Levin
2025-10-08 18:35   ` Chris Mason
2025-10-08 17:57 ` Bart Van Assche
2025-10-08 18:04   ` Chris Mason
2025-10-08 18:14     ` Bart Van Assche
2025-10-08 18:42       ` Chris Mason
2025-10-08 21:08     ` Kees Cook
2025-10-09  1:37       ` Chris Mason
2025-10-08 18:33 ` Sasha Levin
2025-10-09  1:43   ` Chris Mason [this message]
2025-10-09 14:49     ` Paul E. McKenney
2025-10-08 19:08 ` Andrew Lunn
2025-10-08 19:28   ` Arnaldo Carvalho de Melo
2025-10-08 19:33     ` Laurent Pinchart
2025-10-08 19:39       ` Arnaldo Carvalho de Melo
2025-10-08 20:29         ` Andrew Lunn
2025-10-08 20:53           ` Mark Brown
2025-10-09  9:37         ` Laurent Pinchart
2025-10-09 12:48           ` Arnaldo Carvalho de Melo
2025-10-08 19:29   ` Laurent Pinchart
2025-10-08 19:50     ` Bird, Tim
2025-10-08 20:30       ` Sasha Levin
2025-10-09 12:32         ` Arnaldo Carvalho de Melo
2025-10-08 20:30       ` James Bottomley
2025-10-08 20:38         ` Bird, Tim
2025-10-08 22:21           ` Jiri Kosina
2025-10-09  9:14           ` Laurent Pinchart
2025-10-09 10:03             ` Chris Mason
2025-10-10  7:54               ` Laurent Pinchart
2025-10-10 11:40                 ` James Bottomley
2025-10-10 11:53                   ` Laurent Pinchart
2025-10-10 14:21                     ` Steven Rostedt
2025-10-10 14:35                   ` Bird, Tim
2025-10-09 14:30             ` Steven Rostedt
2025-10-09 14:51               ` Andrew Lunn
2025-10-09 15:05                 ` Steven Rostedt
2025-10-10  7:59                 ` Laurent Pinchart
2025-10-10 14:15                   ` Bird, Tim
2025-10-10 15:07                     ` Joe Perches
2025-10-10 16:01                       ` checkpatch encouragement improvements (was RE: [MAINTAINERS / KERNEL SUMMIT] AI patch review tools) Bird, Tim
2025-10-10 17:11                         ` Rob Herring
2025-10-10 17:33                           ` Arnaldo Carvalho de Melo
2025-10-10 19:21                           ` Joe Perches
2025-10-10 16:11                       ` [MAINTAINERS / KERNEL SUMMIT] AI patch review tools Steven Rostedt
2025-10-10 16:47                         ` Joe Perches
2025-10-10 17:42                           ` Steven Rostedt
2025-10-11 10:28                         ` Mark Brown
2025-10-09 16:31               ` Chris Mason
2025-10-09 17:19                 ` Arnaldo Carvalho de Melo
2025-10-09 17:24                   ` Arnaldo Carvalho de Melo
2025-10-09 17:31                     ` Alexei Starovoitov
2025-10-09 17:47                       ` Arnaldo Carvalho de Melo
2025-10-09 18:42                     ` Chris Mason
2025-10-09 18:56                       ` Linus Torvalds
2025-10-10 15:52                         ` Mauro Carvalho Chehab
2025-10-09 14:47             ` Bird, Tim
2025-10-09 15:11               ` Andrew Lunn
2025-10-09 17:58               ` Mark Brown
2025-10-09  1:15         ` Chris Mason
2025-10-08 20:37     ` Andrew Lunn
2025-10-09 12:40       ` Arnaldo Carvalho de Melo
2025-10-09 14:52 ` Paul E. McKenney
2025-10-10  3:08 ` Krzysztof Kozlowski
2025-10-10 14:12   ` Chris Mason
2025-10-31 16:51   ` Stephen Hemminger
2025-10-14  7:16 ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=796882a3-cb05-41a9-b7ca-8af49a05623f@meta.com \
    --to=clm@meta.com \
    --cc=ast@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=ksummit@lists.linux.dev \
    --cc=sashal@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox