File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1313#include <mmu.h>
1414LOG_MODULE_DECLARE (os , CONFIG_KERNEL_LOG_LEVEL );
1515
16+ #ifdef CONFIG_DEMAND_PAGING
17+ #include <zephyr/kernel/mm/demand_paging.h>
18+ #endif
19+
1620#if defined(CONFIG_BOARD_QEMU_X86 ) || defined(CONFIG_BOARD_QEMU_X86_64 )
1721FUNC_NORETURN void arch_system_halt (unsigned int reason )
1822{
@@ -476,6 +480,20 @@ void z_x86_page_fault_handler(struct arch_esf *esf)
476480#endif /* CONFIG_X86_KPTI */
477481 if (was_valid_access ) {
478482 /* Page fault handled, re-try */
483+
484+ #ifdef CONFIG_EVICTION_LRU
485+ /* Currently only LRU eviction algorithm needs to be marked.
486+ * So for now, skip it for others to avoid unnecessary
487+ * processing.
488+ */
489+ uintptr_t phys , ret ;
490+
491+ ret = arch_page_info_get (virt , & phys , false);
492+ if ((ret & ARCH_DATA_PAGE_NOT_MAPPED ) != ARCH_DATA_PAGE_NOT_MAPPED ) {
493+ k_mem_paging_eviction_accessed (phys );
494+ }
495+ #endif
496+
479497 return ;
480498 }
481499 }
You can’t perform that action at this time.
0 commit comments