[mm_supv]: Replace the MM user core bump pool allocator with the DXE allocator logic or linked_list_allocator

Open
#1,999 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
embedded-iot

Research direction

Start with patina_mm_user_core/src/pool_allocator.rs and its existing allocator tests, then compare the FixedSizeBlockAllocator in patina_dxe_core/src/allocator and the linked_list_allocator option. Choose an approach that reuses freed memory, returns empty pages through the existing PageAllocatorBackend, and works under Ring 3 constraints; finish when the existing pool allocator tests pass.

Written by the indexing model from the issue text.

Description

state:backlog state:needs-triage type:feature-request urgency:low
Feature Overview

The MM user core's global allocator (PoolAllocator in patina_mm_user_core/src/pool_allocator.rs) is a bump allocator. It takes pages from the supervisor through the AllocPage/FreePage syscalls and hands out pieces from the current block. A block's pages go back to the supervisor only when every allocation in it is freed. Space freed in the middle of a block is never reused, so a long-running MM runtime with mixed allocation lifetimes can keep requesting more pages. The DXE core already has a general-purpose heap (FixedSizeBlockAllocator in patina_dxe_core/src/allocator).

https://github.com/OpenDevicePartnership/patina/pull/1875#discussion_r4556987130

Solution Overview

Compare two options, keeping the existing PageAllocatorBackend (syscall page source) underneath: (1) reuse the DXE core's fixed-size block allocator logic, moved into a shared crate if needed, or (2) use the linked_list_allocator crate, which would need a cargo-deny review. Pick the one that reuses freed memory, returns empty pages to the supervisor, and fits the Ring 3 constraints. Keep the existing pool allocator tests as the acceptance bar.

Alternatives Considered

No response

Urgency

Low

Are you going to implement the feature request?

I will implement the feature

Do you need maintainer feedback?

No maintainer feedback needed

Anything else?

No response

Dominant language
Rust
Stars
568
Forks
63
Avg merge
1d 16h
Merged PRs (30d)
60

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenDevicePartnership/patina

All issues in OpenDevicePartnership/patina

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.