mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:27:43 +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)
|
bool Region::do_remap_vmobject_page(size_t page_index, bool with_flush)
|
||||||
{
|
{
|
||||||
SpinlockLocker lock(vmobject().m_lock);
|
|
||||||
if (!m_page_directory)
|
if (!m_page_directory)
|
||||||
return true; // not an error, region may have not yet mapped it
|
return true; // not an error, region may have not yet mapped it
|
||||||
if (!translate_vmobject_page(page_index))
|
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();
|
auto& vmobject = this->vmobject();
|
||||||
bool success = true;
|
bool success = true;
|
||||||
|
SpinlockLocker lock(vmobject.m_lock);
|
||||||
vmobject.for_each_region([&](auto& region) {
|
vmobject.for_each_region([&](auto& region) {
|
||||||
if (!region.do_remap_vmobject_page(page_index, with_flush))
|
if (!region.do_remap_vmobject_page(page_index, with_flush))
|
||||||
success = false;
|
success = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue