Optimize system PTE deallocation by avoiding immediate and expensive TLB flush
All checks were successful
Builds / ExectOS (i686, release) (push) Successful in 28s
Builds / ExectOS (amd64, release) (push) Successful in 30s
Builds / ExectOS (amd64, debug) (push) Successful in 41s
Builds / ExectOS (i686, debug) (push) Successful in 39s

This commit is contained in:
2026-01-05 16:59:35 +01:00
parent 410286d012
commit 3a087766cc

View File

@@ -319,6 +319,9 @@ MM::Pte::ReleaseSystemPtes(IN PMMPTE StartingPte,
PMMPTE NextPte, PreviousPte, ReleasedPte;
ULONG ClusterSize;
/* Clear the PTEs before releasing them */
RtlZeroMemory(StartingPte, NumberOfPtes * MM::Paging::GetPteSize());
/* Raise runlevel and acquire lock to protect the PTE pool */
KE::RaiseRunLevel RunLevel(DISPATCH_LEVEL);
KE::QueuedSpinLockGuard SpinLock(SystemSpaceLock);
@@ -408,9 +411,6 @@ MM::Pte::ReleaseSystemPtes(IN PMMPTE StartingPte,
/* Link the new block into the free list */
MM::Paging::SetNextEntry(StartingPte, MM::Paging::GetNextEntry(ReleasedPte));
MM::Paging::SetNextEntry(ReleasedPte, MM::Paging::GetPteDistance(StartingPte, SystemPteBase));
/* Flush the TLB to ensure address translation consistency */
AR::CpuFunc::FlushTlb();
}
/**