From: David van Moolenbroek Date: Sun, 6 Sep 2015 14:56:30 +0000 (+0200) Subject: VM: allocate cache pages in mmap region X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=refs%2Fchanges%2F54%2F3154%2F1;p=minix.git 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 --- 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;