Re: [PATCH] ext4: rralloc - (former rotalloc) improved round-robin allocation policy

From: Mario Lohajner

Date: Fri Feb 27 2026 - 10:25:29 EST




On 27. 02. 2026. 02:12, Theodore Tso wrote:
On Thu, Feb 26, 2026 at 10:50:29PM +0100, Mario Lohajner wrote:
The primary purpose of rralloc is to improve allocation distribution
and avoid hotspotting. Performance improvements are not the goal here...

You haven't explained *why* allocation distribution and avoiding
hotspotting is something we should care about.

If it's not performance, then why? How does reducing hotspotting
improve things for the user? Why should we care about this goal that
apparently is so important to you?

- Ted

Hello Ted,

The motivation behind rralloc is to promote even allocation across the
available LBA under overwrite-heavy workloads.

With the regular allocator, repeated allocations can concentrate the
pressure in specific regions (e.g., in-place overwrites or LBA start).

rralloc spreads allocations across the LBA, reducing localized
contention while:
* promoting existing stream allocation behavior
* distributing LBA space per CPU
* preserving intra-file locality and heuristics
* using the entire LBA in a round-robin manner
* minimizing contention and races
* keeping the regular allocator isolated and intact

Block group usage analysis confirms that rralloc distributes
allocations evenly without degrading baseline throughput:
* small/medium/large file fragmentation experiments
* synthetic tests
* real-world tests (kernel source tree copies)

https://github.com/mlohajner/RRALLOC

Why it matters:
Concentrated allocation can create contention, write amplification, and
uneven LBA utilization even on modern NVMe/SSD devices.
rralloc promotes round-robin allocation across the entire LBA,
with per-CPU zones, ensuring more even allocation distribution while
leaving throughput and existing heuristics unchanged.

Workloads include (but not limited to):
* media files processing and rendering
* builds/compilations
* database workloads

End user impact:
Users can enable rralloc at mount to take advantage of this alternative
allocation policy.
Regular allocator behavior remains unchanged for those who prefer linear
or traditional allocation.

This approach is backward-compatible, non-intrusive, and preserves
on-disk format and existing heuristics.

Preliminary observations under heavy multi-threaded workloads suggest
reduced contention effects, but this has not yet been fully characterized.

Regards,
Mario Lohajner (manjo)