Linus Torvalds's first LLM-assisted patch series
Linus Torvalds posted ten LLM-assisted Linux patches that speed folio reads but contain a reported race.
At the Linux Maintainers Summit, Linus Torvalds said he used a large language model while preparing a patch series for a longstanding folio-lookup problem, and he has now posted the ten patches for review. The changes mark hot folios and delay their release for an RCU period so fast-path reads can access folio data without taking a refcount, producing roughly an order-of-magnitude speedup on a read-heavy benchmark. Reviewers have already identified a race condition, so further revision is required. The model used is not named.
- Ten patches change folio lookup and delay release across an RCU period.
- A read-heavy benchmark reportedly showed about a tenfold speedup.
- Reviewers already found a race condition that needs more work.
- Torvalds said he used an LLM, but the model is unnamed.
Full article204 words · extracted from lwn.net · click to collapse
The fairly short series of ten patches basically enhances folio lookup by noticing when folios are hot, and setting a "delay releasing this folio until after a RCU period", and then using that RCU delay it does not just the folio lookup itself under RCU (which we've done forever), but also the actual folio data accesses themselves under RCU. No refcount taking needed for the fastpath where we can just read the data from the folio entirely in an RCU-protected region when the user copy doesn't cause page faults.
The end result is an order-of-magnitude speedup for a read()-heavy
benchmark. Review has already identified a race
condition in the code, though, so further work will be needed.
The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:
Note: you can avoid this step in the future by logging into your LWN account.
Text extracted automatically; images, tables and formatting may be missing. Original: https://lwn.net/Articles/1100449/