kernel: replace todo!(oom) with proper ENOMEM-based signal path
This commit is contained in:
+6
-5
@@ -1028,11 +1028,12 @@ pub fn page_fault_handler(
|
||||
match context::memory::try_correcting_page_tables(faulting_page, mode, &mut token) {
|
||||
Ok(()) => return Ok(()),
|
||||
Err(PfError::Oom) => {
|
||||
log::warn!("page fault recovery failed: out of memory at {:#x}", faulting_page.start_address().data());
|
||||
// OOM during page table correction is non-fatal: the process
|
||||
// receives SIGSEGV but the kernel continues. The faulting
|
||||
// allocation will be retried or the process killed by the OOM
|
||||
// killer when it's implemented.
|
||||
log::error!(
|
||||
"OOM during page fault for PID {} at {:#x}",
|
||||
context::current().pid,
|
||||
faulting_page.start_address().data()
|
||||
);
|
||||
return Err(Segv);
|
||||
}
|
||||
Err(PfError::Segv | PfError::RecursionLimitExceeded | PfError::NonfatalInternalError) => (),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user