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

Bounded file-backed page cache with explicit residency and mapping pins — implementation. More...

import std;
import lib.error;
import zxfoundation.base.types;
import zxfoundation.memory.pmm;
import zxfoundation.memory.hhdm;
import zxfoundation.memory.pmm.types;
import zxfoundation.memory.kmalloc;
import zxfoundation.scoms.kobject.base;
import zxfoundation.sync.qspinlock.core;
import zxfoundation.memory.page_cache.types;
import zxfoundation.sync.lockable;
import arch.s390x.cpu.skey;
import zxfoundation.scoms.kobject.types;
import zxfoundation.dgp.isolation.types;
import zxfoundation.memory.objects;
import zxfoundation.dgp.memory_contract;
Include dependency graph for core.cxx:

Functions

auto zxfoundation::memory::page_cache::detail::abort_loading_locked (cache_entry &entry, u32 generation) noexcept -> void
auto zxfoundation::memory::page_cache::detail::acquire_mapping_locked (cache_entry &entry, u8 storage_key) noexcept -> std::expected< page_lease, lib::kernel_error >
auto zxfoundation::memory::page_cache::acquire_page (void *node, u32 index, u8 storage_key) noexcept -> std::expected< page_lease, lib::kernel_error >
 Find or populate a page and acquire one VM mapping lease.
auto zxfoundation::memory::page_cache::detail::begin_evict_locked (cache_entry &entry) noexcept -> bool
auto zxfoundation::memory::page_cache::clear_dirty_phys (u64 phys) noexcept -> void
 Clear software and hardware dirty state after a successful writeback.
auto zxfoundation::memory::page_cache::duplicate_binding (const cache_binding &source, u8 storage_key) noexcept -> std::expected< cache_binding, lib::kernel_error >
 Acquire a second mapping pin for the same cache page.
auto zxfoundation::memory::page_cache::detail::ensure_entries_locked () noexcept -> bool
auto zxfoundation::memory::page_cache::evict_phys (u64 phys) noexcept -> bool
 Write back and evict a clean, unmapped cache page.
auto zxfoundation::memory::page_cache::evict_range (u64 phys_start, u64 phys_end) noexcept -> u32
 Evict cache pages contained in a physical drain range.
auto zxfoundation::memory::page_cache::detail::find_key_locked (void *node, u32 index) noexcept -> cache_entry *
auto zxfoundation::memory::page_cache::detail::find_phys_locked (u64 phys) noexcept -> cache_entry *
auto zxfoundation::memory::page_cache::detail::harvest_dirty_locked (cache_entry &entry) noexcept -> void
constexpr auto zxfoundation::memory::page_cache::detail::hash_mix (u64 value) noexcept -> u64
auto zxfoundation::memory::page_cache::detail::index_of (const cache_entry &entry) noexcept -> u32
auto zxfoundation::memory::page_cache::install_reader (read_page_fn reader) noexcept -> std::expected< void, lib::kernel_error >
 Install the filesystem page reader used to populate cache misses.
auto zxfoundation::memory::page_cache::install_writer (write_page_fn writer) noexcept -> std::expected< void, lib::kernel_error >
 Install the filesystem page writer used before dirty eviction.
auto zxfoundation::memory::page_cache::is_dirty_phys (u64 phys) noexcept -> bool
 Probe dirty state by physical page through the PFN hash index.
auto zxfoundation::memory::page_cache::detail::key_bucket (void *node, u32 index) noexcept -> u32
auto zxfoundation::memory::page_cache::detail::link_key_locked (cache_entry &entry) noexcept -> void
auto zxfoundation::memory::page_cache::detail::link_phys_locked (cache_entry &entry) noexcept -> void
auto zxfoundation::memory::page_cache::mark_dirty_binding (const cache_binding &binding) noexcept -> std::expected< void, lib::kernel_error >
 Mark the page held by a live VM slot dirty.
auto zxfoundation::memory::page_cache::mark_dirty_phys (u64 phys) noexcept -> void
 Mark a cache page dirty by physical address.
auto zxfoundation::memory::page_cache::detail::next_generation (u32 generation) noexcept -> u32
auto zxfoundation::memory::page_cache::detail::phys_bucket (u64 phys) noexcept -> u32
auto zxfoundation::memory::page_cache::reclaim_unmapped (u32 target_pages) noexcept -> u32
 Reclaim up to target_pages unmapped cache pages.
auto zxfoundation::memory::page_cache::release (page_lease &&lease) noexcept -> std::expected< void, lib::kernel_error >
 Consume a failed-to-install lease and release its mapping pin.
auto zxfoundation::memory::page_cache::release_binding (cache_binding &binding) noexcept -> std::expected< void, lib::kernel_error >
 Release the VM mapping pin represented by a durable slot binding.
auto zxfoundation::memory::page_cache::detail::release_entry_locked (cache_entry &entry) noexcept -> void
auto zxfoundation::memory::page_cache::detail::reserve_loading_locked (void *node, u32 index) noexcept -> cache_entry *
auto zxfoundation::memory::page_cache::detail::reset_entry (cache_entry &entry) noexcept -> void
auto zxfoundation::memory::page_cache::resident_count () noexcept -> u32
 Return the number of cache-resident pages.
auto zxfoundation::memory::page_cache::detail::restore_ready_locked (cache_entry &entry, u32 generation) noexcept -> void
auto zxfoundation::memory::page_cache::detail::unlink_key_locked (cache_entry &entry) noexcept -> void
auto zxfoundation::memory::page_cache::detail::unlink_phys_locked (cache_entry &entry) noexcept -> void
auto zxfoundation::memory::page_cache::detail::update_authority_key_locked (cache_entry &entry, u8 storage_key) noexcept -> std::expected< void, lib::kernel_error >

Variables

cache_entryzxfoundation::memory::page_cache::detail::g_entries {nullptr}
u32 zxfoundation::memory::page_cache::detail::g_free_head {PAGE_CACHE_SLOT_INVALID}
u32 * zxfoundation::memory::page_cache::detail::g_key_heads {nullptr}
zxfoundation::sync::qspinlock::qspinlock zxfoundation::memory::page_cache::detail::g_lock {}
u32 * zxfoundation::memory::page_cache::detail::g_phys_heads {nullptr}
read_page_fn zxfoundation::memory::page_cache::detail::g_reader {nullptr}
u32 zxfoundation::memory::page_cache::detail::g_resident_count {0U}
write_page_fn zxfoundation::memory::page_cache::detail::g_writer {nullptr}

Detailed Description

Bounded file-backed page cache with explicit residency and mapping pins — implementation.

SPDX-License-Identifier: Apache-2.0

Function Documentation

◆ evict_phys()

auto zxfoundation::memory::page_cache::evict_phys ( u64 phys) ->bool
nodiscardexportnoexcept

Write back and evict a clean, unmapped cache page.

Returns
True only when the cache's resident PMM pin was released.