Kernel: If someone else zero-fills a shared VMO page, don't freak out.
Just map the new page and move on.
This commit is contained in:
parent
6158f456fa
commit
266e77259e
Notes:
sideshowbarker
2024-07-19 15:39:36 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/266e77259e8
1 changed files with 11 additions and 0 deletions
|
@ -233,6 +233,17 @@ bool MemoryManager::zero_page(Region& region, unsigned page_index_in_region)
|
|||
{
|
||||
ASSERT_INTERRUPTS_DISABLED();
|
||||
auto& vmo = region.vmo();
|
||||
auto& vmo_page = vmo.physical_pages()[region.first_page_index() + page_index_in_region];
|
||||
sti();
|
||||
LOCKER(vmo.m_paging_lock);
|
||||
cli();
|
||||
if (!vmo_page.is_null()) {
|
||||
#ifdef PAGE_FAULT_DEBUG
|
||||
dbgprintf("MM: zero_page() but page already present. Fine with me!\n");
|
||||
#endif
|
||||
remap_region_page(region, page_index_in_region, true);
|
||||
return true;
|
||||
}
|
||||
auto physical_page = allocate_physical_page(ShouldZeroFill::Yes);
|
||||
#ifdef PAGE_FAULT_DEBUG
|
||||
dbgprintf(" >> ZERO P%x\n", physical_page->paddr().get());
|
||||
|
|
Loading…
Add table
Reference in a new issue