Hacker News· janvdberg·· 2 小时前精选AI 评分68
Linus Torvalds 发布首个 LLM 辅助内核补丁系列
Linus Torvalds's first LLM-assisted patch series
AI 导读
Linus Torvalds 在 Maintainers Summit 上透露,他用 LLM 编写了一个针对内核长期问题的补丁系列并已发布评审。十个补丁把 folio 数据访问也纳入 RCU 保护区域,使 read() 密集型基准测试获得约一个数量级的加速;评审已发现一处 race condition,仍需进一步修改。原文链接:https://lwn.net/Articles/1100449/
推荐理由
Linus 公开了他用 LLM 改写的内核 folio 查询补丁,附带一个数量级的读密集基准加速,对评估 LLM 介入底层系统编程有具体参考。
正文
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