[RFC] mm: alloc__by: create a function for allocate pages in small microsseconds in boards no-MMU

From: dev12124

Date: Fri Nov 20 2026 - 01:08:47 EST



Hi memory subsystem,

Actually, boards no-MMU do not have an integrated MMU to translate physical to virtual addresses or support hardware paging and; for this, a few points:

I. Requirement for Contiguous Memory
Without an MMU, the kernel cannot combine scattered physical blocks to simulate a continuous space, making the search for and allocation of larger blocks very slow due to fragmentation.

II. Demand Paging
The system cannot defer physical allocation via page faults; instead, it must reserve entire blocks in advance.

III. Use of simplified allocators
such as SLUB_TINY or linear free-list scans (instead of the standard SLUB); it saves space by scanning simple lists of blocks, but it performs very slowly during allocation.

IV. Proposed approach
The function alloc_by(size, address_initial, flag) haves:
* pre-reserved pool per size order;
* cache fast-path no global lock;
* bitmap O(1) of free contiguous blocks.
This bitmap, more specifically the blocks, have the pre-reserved pool (per size order)and the pool have word 2:
* Word 1: The initial address (starts in cache fast-path)
* Word 2: The final address.
For example, a Program allocates 277 bytes, the alloc_by() enter and verify the bitmap -> viewing the request is 277 bytes, the aproximated size is 512 bytes and alloc_by alloc 512 bytes.

Thanks,
João Guilherme da Silva Freitas Lima <joaoanandalima@xxxxxxxxx>