mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 10:12:25 -05:00
Kernel: Leave VMObject alone on OOM during CoW fault
If we OOM during a CoW fault and fail to allocate a new page for the writing process, just leave the original VMObject alone so everyone else can keep using it.
This commit is contained in:
parent
9c856811b2
commit
4419685b7e
Notes:
sideshowbarker
2024-07-19 07:13:16 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/4419685b7e6
1 changed files with 1 additions and 1 deletions
|
@ -397,12 +397,12 @@ PageFaultResponse Region::handle_cow_fault(size_t page_index_in_region)
|
|||
#ifdef PAGE_FAULT_DEBUG
|
||||
dbg() << " >> It's a COW page and it's time to COW!";
|
||||
#endif
|
||||
auto physical_page_to_copy = move(page_slot);
|
||||
auto page = MM.allocate_user_physical_page(MemoryManager::ShouldZeroFill::No);
|
||||
if (page.is_null()) {
|
||||
klog() << "MM: handle_cow_fault was unable to allocate a physical page";
|
||||
return PageFaultResponse::ShouldCrash;
|
||||
}
|
||||
auto physical_page_to_copy = move(page_slot);
|
||||
u8* dest_ptr = MM.quickmap_page(*page);
|
||||
const u8* src_ptr = vaddr().offset(page_index_in_region * PAGE_SIZE).as_ptr();
|
||||
#ifdef PAGE_FAULT_DEBUG
|
||||
|
|
Loading…
Add table
Reference in a new issue