{"slug": "linus-torvalds-ai-code-improved-performance-wins-with-reworked-code", "title": "Linus Torvalds' AI Code Improved: Performance Wins with Reworked Code", "summary": "Meta engineer Kiryl Shutsemau posted a patch series reworking Linus Torvalds' AI-assisted Linux kernel code that lets filemap_read() and shmem copy from the page cache without taking a folio reference, freeing such a folio only after an RCU grace period. Shutsemau tested the patches across EXT4, TMPFS, XFS and a raw block device with 64 threads on an AMD Ryzen Threadripper, with and without default CPU security mitigations, reporting what the article calls a \"fabulous improvement.\" The patches remain a request for comments with open design elements, but the work is aimed at reaching the mainline kernel.", "body_md": "# Linus Torvalds' AI Code Improved: Huge Performance Wins With Reworked Code\n\nLast week I wrote about Linus Torvalds leveraging AI to come up with \n\nKiryl announced today his patch series based on Torvalds' code from last week for adapting the Linux kernel memory management code to read from the page cache without folio references. He explained with the patch cover letter:\n\n\"Small reads of one file from many CPUs all take and drop a reference on the same folio, and its refcount bounces between the CPUs.  This series lets filemap_read() and shmem copy from the page cache without taking a reference.  It is Linus' RFC, reworked: a folio that such a reader may copy from is freed only after an RCU grace period.\"\n\nHe went on to test the improvements across EXT4, TMPFS, and XFS file-systems and a raw block device. Testing was with 64 threads on an AMD Ryzen Threadripper CPU and testing with and without the default CPU security mitigations. The results are pretty fantastic:\n\nFabulous improvement. The patches are still treated as a request for comments and some open design elements around the work remains, but hopefully it will be all addressed soon and be in the mainline kernel in the not too distant future. The patches can be found on the \n\n[a hefty Linux kernel improvement using Claude Code](https://www.phoronix.com/news/Linus-Torvalds-Claude-Code). The code is for reading from the page cache without folio references to help workloads of small reads from a single file across many CPU threads. Meta engineer Kiryl Shutsemau has taken that code and reworked it and showing extremely promising performance results.\nKiryl announced today his patch series based on Torvalds' code from last week for adapting the Linux kernel memory management code to read from the page cache without folio references. He explained with the patch cover letter:\n\nHe went on to test the improvements across EXT4, TMPFS, and XFS file-systems and a raw block device. Testing was with 64 threads on an AMD Ryzen Threadripper CPU and testing with and without the default CPU security mitigations. The results are pretty fantastic:\n\nFabulous improvement. The patches are still treated as a request for comments and some open design elements around the work remains, but hopefully it will be all addressed soon and be in the mainline kernel in the not too distant future. The patches can be found on the\n\n[Linux kernel mailing list](https://lore.kernel.org/lkml/20261019154913.1765974-1-kas@kernel.org/).", "url": "https://wpnews.pro/news/linus-torvalds-ai-code-improved-performance-wins-with-reworked-code", "canonical_source": "https://www.phoronix.com/news/Reading-Page-Cache-WO-Folio-Ref", "published_at": "2026-10-19 19:48:58+00:00", "updated_at": "2026-10-19 20:17:44.394473+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-tools"], "entities": ["Linus Torvalds", "Kiryl Shutsemau", "Meta", "Linux kernel", "AMD Ryzen Threadripper", "EXT4", "TMPFS", "XFS"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/linus-torvalds-ai-code-improved-performance-wins-with-reworked-code", "markdown": "https://wpnews.pro/news/linus-torvalds-ai-code-improved-performance-wins-with-reworked-code.md", "text": "https://wpnews.pro/news/linus-torvalds-ai-code-improved-performance-wins-with-reworked-code.txt", "jsonld": "https://wpnews.pro/news/linus-torvalds-ai-code-improved-performance-wins-with-reworked-code.jsonld"}}