Merge pull request #668 from betrusted-io/opt-mmu-real

remove some redundant mmu flush commands
This commit is contained in:
bunnie 2025-07-26 00:48:03 +08:00 committed by GitHub
commit 1de1693b7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -258,7 +258,7 @@ impl MemoryMapping {
/// As such, this will only have an observable effect once code returns /// As such, this will only have an observable effect once code returns
/// to userspace. /// to userspace.
pub fn activate(self) -> Result<(), xous_kernel::Error> { pub fn activate(self) -> Result<(), xous_kernel::Error> {
unsafe { flush_mmu() }; // unsafe { flush_mmu() }; // redundant - adds 9% time to context switch benchmark when present!
satp::write(self.satp); satp::write(self.satp);
unsafe { flush_mmu() }; unsafe { flush_mmu() };
Ok(()) Ok(())

View file

@ -431,7 +431,7 @@ impl Swap {
true, true,
) )
.ok(); .ok();
unsafe { crate::arch::mem::flush_mmu() }; // unsafe { crate::arch::mem::flush_mmu() }; // redundant?
} else { } else {
already_mapped = true; already_mapped = true;
} }