From 1648567c18b05c5e3426cba45d6e9a7b3ebc0c91 Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 28 May 2024 20:30:27 +0800 Subject: [PATCH] add an extra reserved page for OOM handler seems an extra page is necessary to handle the edge case of OOM during lend/move --- services/xous-swapper/src/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/services/xous-swapper/src/main.rs b/services/xous-swapper/src/main.rs index 62b134ca4..6dc9e4dfe 100644 --- a/services/xous-swapper/src/main.rs +++ b/services/xous-swapper/src/main.rs @@ -160,9 +160,8 @@ pub struct SwapCountTracker { /// Known things the swapper has to allocate memory for in hard-OOM: /// - L1 page table entries for tracking swap /// - An extra page for stack (needed for cramium targets, but not on precursor due to HAL differences) -/// - An additional page will be requested in case of panic in hard OOM for TLS, but these shouldn't happen -/// so we don't reserve it. -const HARD_OOM_RESERVED_PAGES: usize = 2; +/// - An additional page seems to be necessary for handling OOM-during-move-or-lend edge cases. +const HARD_OOM_RESERVED_PAGES: usize = 3; /// This structure contains shared state accessible between the userspace code and the blocking swap call /// handler.