Hacker News· janvdberg·· 25 天前AI 评分58
Linus Torvalds 发布首个 LLM 辅助编写的内核补丁系列
Linus Torvalds's first LLM-assisted patch series
AI 摘要
Linus Torvalds 在维护者峰会上透露用大语言模型辅助编写了一组解决长期问题的补丁,并已提交评审。这组共 10 个补丁通过识别 folio 是否“热”并设置“延迟到 RCU 周期后再释放”,把 folio 数据访问本身也放进 RCU 保护区内,快速路径无需取引用计数,在用户拷贝不触发缺页时可直接读取数据,使读密集型 read() 基准获得一个数量级加速。
正文 · 原文
At the recently concluded Maintainers Summit, Linus Torvalds said that he had been using a large language model to work on a patch series addressing a longstanding problem; he has now posted that series for review.
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.
来源:Hacker News · lwn.net
00