mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Kernel: Release page directory and MM locks sooner in space finalization
We don't need to hold these locks when tearing down the region tree. Release them as soon as unmapping is finished.
This commit is contained in:
parent
fcd3844da6
commit
a44316fa8b
Notes:
sideshowbarker
2024-07-17 19:59:34 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a44316fa8b4
1 changed files with 6 additions and 4 deletions
|
@ -321,10 +321,12 @@ void AddressSpace::remove_all_regions(Badge<Process>)
|
|||
{
|
||||
VERIFY(Thread::current() == g_finalizer);
|
||||
SpinlockLocker locker(m_lock);
|
||||
SpinlockLocker pd_locker(m_page_directory->get_lock());
|
||||
SpinlockLocker mm_locker(s_mm_lock);
|
||||
for (auto& region : m_regions)
|
||||
(*region).unmap_with_locks_held(Region::ShouldDeallocateVirtualRange::No, ShouldFlushTLB::No, pd_locker, mm_locker);
|
||||
{
|
||||
SpinlockLocker pd_locker(m_page_directory->get_lock());
|
||||
SpinlockLocker mm_locker(s_mm_lock);
|
||||
for (auto& region : m_regions)
|
||||
(*region).unmap_with_locks_held(Region::ShouldDeallocateVirtualRange::No, ShouldFlushTLB::No, pd_locker, mm_locker);
|
||||
}
|
||||
m_regions.clear();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue