From f9ac76867be8c7f6943ca42d93521e5ad97e42a4 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Tue, 16 Feb 2016 22:01:49 +0100 Subject: Avoid panics on physical memory exhaustion * vm/vm_resident (vm_page_grab): Return NULL instead of calling panic on memory exhaustion. --- vm/vm_resident.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'vm/vm_resident.c') diff --git a/vm/vm_resident.c b/vm/vm_resident.c index cc7b8091..3d3a76de 100644 --- a/vm/vm_resident.c +++ b/vm/vm_resident.c @@ -784,8 +784,10 @@ vm_page_t vm_page_grab( mem = vm_page_alloc_pa(0, VM_PAGE_SEL_DIRECTMAP, VM_PT_KERNEL); - if (mem == NULL) - panic("vm_page_grab"); + if (mem == NULL) { + simple_unlock(&vm_page_queue_free_lock); + return NULL; + } if (external) vm_page_external_count++; -- cgit v1.2.3