How it works
Pick a well-measured bottleneck and describe to the agent the problem, previous attempts and why they failed.
Ask the agent to write the implementation along with test programs that reproduce the contention.
Run the benchmarks yourself on real hardware and feed the numbers back to the agent to adjust the approach.
Ask the agent for a critical review of the series and a draft of the submission email, and disclose the LLM use in the patch.
Send the series for human review and fold in the fixes the maintainers find.
Prompt
Replace anything in [brackets] with your own details.
I want to eliminate contention on the folio reference count when many threads do small reads of the same cached file. Study the buffered read path in mm/filemap.c, explain why previous approaches raced with reclaim and folio replacement, and propose a patch series that reads from the page cache without taking a reference. Also write a multi-threaded test program that measures reads per second and cycles per read. Don't declare anything safe without explaining the reasoning: I'll run the benchmarks and the series will go through maintainer review.Reported result
8-thread reads went from 10 to 33 million per second on Torvalds' laptop; the revised version went from 13.3 to 304 million per second on a 64-thread Threadripper (about 23x), in a synthetic test. Reviewers found a race before the merge.
As reported by the source. Results depend on your setup and your data.