mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 01:47:34 +00: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
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
|
#ifdef PAGE_FAULT_DEBUG
|
||||||
dbg() << " >> It's a COW page and it's time to COW!";
|
dbg() << " >> It's a COW page and it's time to COW!";
|
||||||
#endif
|
#endif
|
||||||
auto physical_page_to_copy = move(page_slot);
|
|
||||||
auto page = MM.allocate_user_physical_page(MemoryManager::ShouldZeroFill::No);
|
auto page = MM.allocate_user_physical_page(MemoryManager::ShouldZeroFill::No);
|
||||||
if (page.is_null()) {
|
if (page.is_null()) {
|
||||||
klog() << "MM: handle_cow_fault was unable to allocate a physical page";
|
klog() << "MM: handle_cow_fault was unable to allocate a physical page";
|
||||||
return PageFaultResponse::ShouldCrash;
|
return PageFaultResponse::ShouldCrash;
|
||||||
}
|
}
|
||||||
|
auto physical_page_to_copy = move(page_slot);
|
||||||
u8* dest_ptr = MM.quickmap_page(*page);
|
u8* dest_ptr = MM.quickmap_page(*page);
|
||||||
const u8* src_ptr = vaddr().offset(page_index_in_region * PAGE_SIZE).as_ptr();
|
const u8* src_ptr = vaddr().offset(page_index_in_region * PAGE_SIZE).as_ptr();
|
||||||
#ifdef PAGE_FAULT_DEBUG
|
#ifdef PAGE_FAULT_DEBUG
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue