Linus Torvalds is experimenting with AI-driven kernel change generation.

Linus Torvalds has prepared a set of patches for the memory management subsystem in the Linux kernel, implementing an optimization for reading small blocks of data from the page cache without an atomic change to the reference count (refcount) in the folio structure. The commit message indicates that the changes, related tests, and draft notes were created by the AI assistant Claude Code under Torvalds' supervision. The change has been added to a separate branch of the kernel named noref-filemap-read-with-llm, and it is still unclear whether it will be merged into the main branch or if this is merely an internal experiment.

During testing, the patches achieved an increase in the reading throughput of small files in an 8-thread configuration from 9.9-10.4 to 30-33 million operations per second (a 3-fold increase), in a 4-thread configuration from 8.9-11.6 to 25-26 million/sec (a 2-fold increase), and under single-threaded load from 7.9-8.1 to 8.8-8.9 million/sec. The performance gain is attributed to the intense competition between threads when accessing the page cache. For instance, when 8 threads attempt to read 16 bytes of data simultaneously, 99.92% of the time is spent not on reading itself, but on waiting for access to the reference count.

In the patch, to ensure data integrity, instead of setting individual locks, changing reference counts, or intermediate buffering, a workaround is used that employs deferred memory release with synchronization through the RCU (Read-Copy-Update) mechanism. The method proposed in the patch guarantees that a memory page will not be physically released until the reading thread has completed the data copy.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster