mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:47:35 +00:00
Kernel: Take VMObject lock once in Region::remap_vmobject_page()
We were taking and releasing the lock repeatedly instead of holding it across the entire remap operation.
This commit is contained in:
parent
821c80848f
commit
25250590d0
1 changed files with 1 additions and 1 deletions
|
@ -204,7 +204,6 @@ bool Region::map_individual_page_impl(size_t page_index)
|
|||
|
||||
bool Region::do_remap_vmobject_page(size_t page_index, bool with_flush)
|
||||
{
|
||||
SpinlockLocker lock(vmobject().m_lock);
|
||||
if (!m_page_directory)
|
||||
return true; // not an error, region may have not yet mapped it
|
||||
if (!translate_vmobject_page(page_index))
|
||||
|
@ -221,6 +220,7 @@ bool Region::remap_vmobject_page(size_t page_index, bool with_flush)
|
|||
{
|
||||
auto& vmobject = this->vmobject();
|
||||
bool success = true;
|
||||
SpinlockLocker lock(vmobject.m_lock);
|
||||
vmobject.for_each_region([&](auto& region) {
|
||||
if (!region.do_remap_vmobject_page(page_index, with_flush))
|
||||
success = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue