From 1a5c518ee1536db50dccd8766ce78c3790aec059 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 2 Mar 2015 18:21:59 +0100 Subject: More uses of free_some_memory() --- src/kernel/user/process.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/kernel/user/process.c') diff --git a/src/kernel/user/process.c b/src/kernel/user/process.c index 989a47a..4dea882 100644 --- a/src/kernel/user/process.c +++ b/src/kernel/user/process.c @@ -4,6 +4,7 @@ #include #include +#include static int next_pid = 1; @@ -345,14 +346,12 @@ static void proc_usermem_pf(void* p, registers_t *regs, void* addr) { frame = file_get_page(r->file, addr - r->addr + r->file_offset); } if (frame == 0) { - dbg_printf("OOM for process %d ; yielding and waiting for someone to free some RAM.\n", proc->pid); - yield(); + free_some_memory(); } } while (frame == 0); while(!pd_map_page(addr, frame, (r->mode & MM_WRITE) != 0)) { - dbg_printf("OOM(2) for process %d ; yielding and waiting for someone to free some RAM.\n", proc->pid); - yield(); + free_some_memory(); } if (r->file == 0) memset(addr, 0, PAGE_SIZE); // zero out -- cgit v1.2.3