Queued this week into the slab/for-next Git branch ahead of next month's Linux 7.4 merge window is a memory management change for refilling pre-filled sheaves from the barn. In some cases this yields wild improvements to specific synthetic benchmarks...

Queued this week into the slab/for-next Git branch ahead of next month's Linux 7.4 merge window is a memory management change for refilling pre-filled sheaves from the barn. In some cases this yields wild improvements to specific synthetic benchmarks.
Sheaves are the per-CPU, array-based caching layer for the Linux kernel's memory allocator. Sheaves have seen a lot of work since their introduction to the kernel last year and even more optimization work is on the way for Linux 7.4.
Hao Li explained of the memory management code change for refilling prefilled sheaves from the barn:
"Currently, when the prefill API refills a non-full sheaf, it takes the objects from partial slabs and never from the full sheaves in the barn, so once the barn's full list becomes saturated, it stays saturated.For objects freed via kfree_rcu(), every RCU sheaf then has to be flushed to slabs because the barn's full list has no room.
To fix this, let the sheaf refill from the barn first, and introduce a partial sheaf in the barn, which holds the leftover objects.
Only the prefill path needs the partial sheaf. The generic allocation path (__pcs_replace_empty_main()) exchanges an empty sheaf for a full one from the barn, so nothing is left over. The prefill path refills a sheaf that is not necessarily empty, so taking objects from the barn usually leaves leftovers, and the partial sheaf is where they are kept. refill_sheaf() only takes objects from partial slabs and never involves the partial sheaf.
The sheaf is refilled by copying objects from the partial sheaf, and then from a full sheaf taken from the barn if it is still not full. A sheaf that objects were copied from stays in the barn as the partial sheaf if it still holds objects, or goes on the empty list if it is empty. The sheaf being refilled is never replaced.
The gain comes from two sides: every full sheaf taken out makes room on the barn's full list for a future RCU sheaf, and refilling from the barn is cheaper than refilling from partial slabs under list_lock."
The benchmarks with the patch show an overall 24% improvement to a will-it-scale mmap1 test. The impact in the barn_get performance is +22904539.81%, barn_put is +21422544.07%, and the other metrics tend to be double-digit percentage improvements over the baseline.
Quite an impact out of 81 lines of new code. The patch is destined for the Linux 7.4 merge window happening in late October.
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | Intel Delivers A Significant Memory Hotplugging Performance Optimization For Linux | 0 | 4.52 | 27-09-2026 |
| 2 | Linux Kernel's LZ4 Compression Code Being Resynced For Better Performance & Cleanliness | 0 | 9.31 | 27-09-2026 |
| 3 | Improved GPU Reset Coming For Raspberry Pi Boards With Linux 7.4 | 0 | 11.88 | 27-09-2026 |
| 4 | AMD Sends Out New Linux Patches Further Enhancing HDMI 2.1 Reliability | 0 | 10.11 | 25-09-2026 |
| 5 | Patches Posted For Enabling NVMe On All Apple M3 Based SoCs With Linux | 0 | 6.22 | 25-09-2026 |
| 6 | New Patch Series Working Toward DRBD 9 Support In The Linux Kernel | 0 | 7.9 | 27-09-2026 |
| 7 | AI Bug Fixes, Crescent Island Power Brake & Nouveau Fixes For Linux 7.3-rc5 DRM | 0 | 6.17 | 26-09-2026 |
| 8 | Approaching A 10 Second Linux Kernel Build | 0 | 5.03 | 25-09-2026 |
| 9 | New FUTEX Syscalls Back To Being Worked On For Helping Valve's ARM64 Gaming Ambitions | 0 | 8.65 | 25-09-2026 |
| 10 | New Linux Patches For Supporting Lenovo ThinkPad X1 Carbon G14's Second Camera | 0 | 10.81 | 27-09-2026 |