Skip to contentSkip to conversation

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

RFC dev12124 2 participants 3 messages Nov 20 Memory management

lore
Share & tools
lore

dev12124

author
#0 lore raw

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 <[email protected]>

#1 lore raw
Quoted 22 lines · On 11/20/26 07:08, dev12124 wrote:

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.

Quoted 12 lines

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.

Hi,

I think we are much rather looking into removing NOMMU then optimizing it :)

Signature · 3 lines
Cheers,

David
author
#2 lore raw
Quoted 13 lines · David Hildenbrand (Arm)

Hi,

I think we are much rather looking into removing NOMMU then optimizing it :)

Signature · 3 lines
Cheers,

David

Hi,

Thanks! Ok for the atual focuos! :)