mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
Kernel: Do less unnecessary work when tearing down process address space
When deleting an entire AddressSpace, we don't need to do TLB flushes at all (since the entire page directory is going away anyway). We also don't need to deallocate VM ranges one by one, since the entire VM range allocator will be deleted anyway.
This commit is contained in:
parent
a702b6ec42
commit
2323cdd914
3 changed files with 7 additions and 3 deletions
|
@ -320,7 +320,10 @@ void AddressSpace::dump_regions()
|
|||
|
||||
void AddressSpace::remove_all_regions(Badge<Process>)
|
||||
{
|
||||
VERIFY(Thread::current() == g_finalizer);
|
||||
SpinlockLocker lock(m_lock);
|
||||
for (auto& region : m_regions)
|
||||
(*region).unmap(Region::ShouldDeallocateVirtualRange::No, ShouldFlushTLB::No);
|
||||
m_regions.clear();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue