From 4506a0eebfee22b2a5198e1438f5780efdd94aa4 Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Sun, 6 Sep 2015 16:56:30 +0200 Subject: [PATCH] VM: allocate cache pages in mmap region That way, these pages are transferred during live update, as they should. This resolves a mfs crash after a number of live updates. Change-Id: Ia53bec2692b2114c29b96a453beb0f915f56453a --- minix/servers/vm/mem_cache.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/minix/servers/vm/mem_cache.c b/minix/servers/vm/mem_cache.c index 56c596dac..a702bb9fb 100644 --- a/minix/servers/vm/mem_cache.c +++ b/minix/servers/vm/mem_cache.c @@ -121,10 +121,13 @@ do_mapcache(message *msg) * in case instrumentation needs to allocate in-band metadata later. * This does effectively halve the usable part of the caller's address * space, though, so only do this if we are instrumenting at all. + * Also make sure it falls within the mmap range, so that it is + * transferred upon live update. This again cuts the usable part of + * the address space for caching purposes in half. */ alloc_bytes += VM_PAGE_SIZE; #endif - if (!(vr = map_page_region(caller, VM_PAGE_SIZE, VM_DATATOP, + if (!(vr = map_page_region(caller, VM_MMAPBASE, VM_MMAPTOP, alloc_bytes, VR_ANON | VR_WRITABLE, 0, &mem_type_cache))) { printf("VM: map_page_region failed\n"); return ENOMEM;