Kernel: Only register kernel regions with MemoryManager

We were already only tracking kernel regions, this patch just makes it
more clear by having it reflected in the name of the registration
helpers.

We also stop calling them for userspace regions, avoiding some spinlock
action in such cases.
This commit is contained in:
Andreas Kling 2022-01-15 17:01:53 +01:00
commit 8e0387e674
Notes: sideshowbarker 2024-07-18 00:54:03 +09:00
3 changed files with 13 additions and 10 deletions

View file

@ -34,7 +34,9 @@ Region::Region(VirtualRange const& range, NonnullRefPtr<VMObject> vmobject, size
VERIFY((m_range.size() % PAGE_SIZE) == 0);
m_vmobject->add_region(*this);
MM.register_region(*this);
if (is_kernel())
MM.register_kernel_region(*this);
}
Region::~Region()
@ -46,7 +48,8 @@ Region::~Region()
m_vmobject->remove_region(*this);
MM.unregister_region(*this);
if (is_kernel())
MM.unregister_kernel_region(*this);
if (m_page_directory) {
SpinlockLocker page_lock(m_page_directory->get_lock());