From 76d2c6ec7b826c51ec88dbca73465d3c7937f7eb Mon Sep 17 00:00:00 2001 From: lcy1996 <992195697@qq.com> Date: Sat, 17 Nov 2018 23:17:42 +0800 Subject: [PATCH] Fix the bug of active_table_swap() wrongly force unlock in pg fault handler --- crate/memory/src/swap/fifo.rs | 2 ++ kernel/src/memory.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crate/memory/src/swap/fifo.rs b/crate/memory/src/swap/fifo.rs index 80ca368..f282965 100644 --- a/crate/memory/src/swap/fifo.rs +++ b/crate/memory/src/swap/fifo.rs @@ -23,6 +23,8 @@ impl SwapManager for FifoSwapManager { .position(|ref x| x.get_virtaddr() == addr && x.get_token() == token) .expect("address not found"); self.deque.remove(id); + //info!("SwapManager remove token finished: {:x?} vaddr: {:x?}", token, addr); + } fn pop(&mut self, _: &mut T, _: &mut S) -> Option diff --git a/kernel/src/memory.rs b/kernel/src/memory.rs index e90b048..f8d37b5 100644 --- a/kernel/src/memory.rs +++ b/kernel/src/memory.rs @@ -108,7 +108,7 @@ impl Drop for KernelStack { */ pub fn page_fault_handler(addr: usize) -> bool { info!("start handling swap in/out page fault"); - unsafe { ACTIVE_TABLE_SWAP.force_unlock(); } + //unsafe { ACTIVE_TABLE_SWAP.force_unlock(); } info!("active page table token in pg fault is {:x?}", ActivePageTable::token()); let mmset_record = memory_set_record();