Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
|
Eviction algorithm APIs. More...
Functions | |
void | k_mem_paging_eviction_add (struct k_mem_page_frame *pf) |
Submit a page frame for eviction candidate tracking. | |
void | k_mem_paging_eviction_remove (struct k_mem_page_frame *pf) |
Remove a page frame from potential eviction candidates. | |
void | k_mem_paging_eviction_accessed (uintptr_t phys) |
Process a page frame as being newly accessed. | |
struct k_mem_page_frame * | k_mem_paging_eviction_select (bool *dirty) |
Select a page frame for eviction. | |
void | k_mem_paging_eviction_init (void) |
Initialization function. | |
Eviction algorithm APIs.
void k_mem_paging_eviction_accessed | ( | uintptr_t | phys | ) |
#include <zephyr/kernel/mm/demand_paging.h>
Process a page frame as being newly accessed.
The architecture-specific memory fault handler will invoke this to tell the eviction algorithm the provided physical address belongs to a page frame being accessed and such page frame should become unlikely to be considered as the next eviction candidate.
This function is invoked with interrupts locked.
[in] | phys | The physical address being accessed |
void k_mem_paging_eviction_add | ( | struct k_mem_page_frame * | pf | ) |
#include <zephyr/kernel/mm/demand_paging.h>
Submit a page frame for eviction candidate tracking.
The kernel will invoke this to tell the eviction algorithm the provided page frame may be considered as a potential eviction candidate.
This function will never be called before the initial k_mem_paging_eviction_init().
This function is invoked with interrupts locked.
[in] | pf | The page frame to add |
void k_mem_paging_eviction_init | ( | void | ) |
#include <zephyr/kernel/mm/demand_paging.h>
Initialization function.
Called at POST_KERNEL to perform any necessary initialization tasks for the eviction algorithm. k_mem_paging_eviction_select() is guaranteed to never be called until this has returned, and this will only be called once.
void k_mem_paging_eviction_remove | ( | struct k_mem_page_frame * | pf | ) |
#include <zephyr/kernel/mm/demand_paging.h>
Remove a page frame from potential eviction candidates.
The kernel will invoke this to tell the eviction algorithm the provided page frame may no longer be considered as a potential eviction candidate.
This function will only be called with page frames that were submitted using k_mem_paging_eviction_add() beforehand.
This function is invoked with interrupts locked.
[in] | pf | The page frame to remove |
struct k_mem_page_frame * k_mem_paging_eviction_select | ( | bool * | dirty | ) |
#include <zephyr/kernel/mm/demand_paging.h>
Select a page frame for eviction.
The kernel will invoke this to choose a page frame to evict if there are no free page frames. It is not guaranteed that the returned page frame will actually be evicted. If it is then the kernel will call k_mem_paging_eviction_remove() with it.
This function will never be called before the initial k_mem_paging_eviction_init().
This function is invoked with interrupts locked.
[out] | dirty | Whether the page to evict is dirty |