ZXFoundation™ 26h2
Loading...
Searching...
No Matches
core.cxxm File Reference

Unified reclaim: walks page_cache + all VMAs via the SCOMS. More...

import std;
import lib.error;
import zxfoundation.base.types;
Include dependency graph for core.cxxm:

Typedefs

using zxfoundation::memory::reclaim::reclaim_fn = auto (*)(u8 node, u32 target_pages) noexcept -> u32

Functions

auto zxfoundation::memory::reclaim::install (reclaim_fn callback) noexcept -> std::expected< void, lib::kernel_error >
 Install the reclaim callback used by kswapd and allocation retry.
auto zxfoundation::memory::reclaim::reclaim_for_allocation (u8 node, u32 target_pages) noexcept -> std::expected< void, lib::kernel_error >
 Reclaim enough pages to satisfy an allocation retry.
auto zxfoundation::memory::reclaim::reclaim_node (u8 node, u32 target_pages) noexcept -> std::expected< u32, lib::kernel_error >
 Reclaim pages on one NUMA node.
auto zxfoundation::memory::reclaim::reclaim_range (u64 phys_start, u64 phys_end) noexcept -> u32
 Evict every resident page whose physical address lies in [phys_start, phys_end).

Detailed Description

Unified reclaim: walks page_cache + all VMAs via the SCOMS.

SPDX-License-Identifier: Apache-2.0

Function Documentation

◆ install()

auto zxfoundation::memory::reclaim::install ( reclaim_fn callback) ->std::expected< void, lib::kernel_error >
nodiscardexportnoexcept

Install the reclaim callback used by kswapd and allocation retry.

Parameters
[in]callbackCallback that isolates and reclaims pages.
Returns
Success or invalid argument.

◆ reclaim_for_allocation()

auto zxfoundation::memory::reclaim::reclaim_for_allocation ( u8 node,
u32 target_pages )->std::expected< void, lib::kernel_error >
nodiscardexportnoexcept

Reclaim enough pages to satisfy an allocation retry.

Parameters
[in]nodePreferred NUMA node.
[in]target_pagesMinimum progress.
Returns
Success when progress meets the target.

◆ reclaim_node()

auto zxfoundation::memory::reclaim::reclaim_node ( u8 node,
u32 target_pages )->std::expected< u32, lib::kernel_error >
nodiscardexportnoexcept

Reclaim pages on one NUMA node.

Parameters
[in]nodePreferred NUMA node.
[in]target_pagesMinimum requested progress.
Returns
Pages reclaimed or a provider-not-ready error.

◆ reclaim_range()

auto zxfoundation::memory::reclaim::reclaim_range ( u64 phys_start,
u64 phys_end )->u32
nodiscardexportnoexcept

Evict every resident page whose physical address lies in [phys_start, phys_end).

Returns
Number of frames actually freed back to PMM.