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
This commit is contained in:
David van Moolenbroek 2015-09-06 16:56:30 +02:00
parent 7f79fb8810
commit 4506a0eebf

View file

@ -121,10 +121,13 @@ do_mapcache(message *msg)
* in case instrumentation needs to allocate in-band metadata later. * in case instrumentation needs to allocate in-band metadata later.
* This does effectively halve the usable part of the caller's address * This does effectively halve the usable part of the caller's address
* space, though, so only do this if we are instrumenting at all. * 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; alloc_bytes += VM_PAGE_SIZE;
#endif #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))) { alloc_bytes, VR_ANON | VR_WRITABLE, 0, &mem_type_cache))) {
printf("VM: map_page_region failed\n"); printf("VM: map_page_region failed\n");
return ENOMEM; return ENOMEM;