mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:27:45 +00:00
Kernel: Don't hog VMObject lock when remapping a region page
We really only need the VMObject lock when accessing the physical pages array, so once we have a strong pointer to the physical page we want to remap, we can give up the VMObject lock. This fixes a deadlock I encountered while building DOOM on SMP.
This commit is contained in:
parent
10399a258f
commit
b560442fe1
2 changed files with 53 additions and 42 deletions
|
@ -199,7 +199,7 @@ private:
|
|||
Region(NonnullRefPtr<VMObject>, size_t offset_in_vmobject, OwnPtr<KString>, Region::Access access, Cacheable, bool shared);
|
||||
Region(VirtualRange const&, NonnullRefPtr<VMObject>, size_t offset_in_vmobject, OwnPtr<KString>, Region::Access access, Cacheable, bool shared);
|
||||
|
||||
[[nodiscard]] bool remap_vmobject_page(size_t page_index, bool with_flush = true);
|
||||
[[nodiscard]] bool remap_vmobject_page(size_t page_index, NonnullRefPtr<PhysicalPage>);
|
||||
|
||||
void set_access_bit(Access access, bool b)
|
||||
{
|
||||
|
@ -214,6 +214,7 @@ private:
|
|||
[[nodiscard]] PageFaultResponse handle_zero_fault(size_t page_index);
|
||||
|
||||
[[nodiscard]] bool map_individual_page_impl(size_t page_index);
|
||||
[[nodiscard]] bool map_individual_page_impl(size_t page_index, RefPtr<PhysicalPage>);
|
||||
|
||||
RefPtr<PageDirectory> m_page_directory;
|
||||
VirtualRange m_range;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue