X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2945198502e436f29236715c0baca1efadb64480..a49a03122b2def71ff741e78d15b38cd1d171184:/src/mc/RegionSnapshot.cpp diff --git a/src/mc/RegionSnapshot.cpp b/src/mc/RegionSnapshot.cpp index 94acf100e2..104e8ffc46 100644 --- a/src/mc/RegionSnapshot.cpp +++ b/src/mc/RegionSnapshot.cpp @@ -7,6 +7,9 @@ #include #include +#ifdef __FreeBSD__ +# define MAP_POPULATE MAP_PREFAULT_READ +#endif #include "mc/mc.h" #include "src/mc/mc_snapshot.h" @@ -78,7 +81,7 @@ RegionSnapshot dense_region( void *start_addr, void* permanent_addr, size_t size) { // When KSM support is enables, we allocate memory using mmap: - // * we don't want to madvise bits of the heap; + // * we don't want to advise bits of the heap as mergable; // * mmap gives data aligned on page boundaries which is merge friendly. simgrid::mc::Buffer data; if (_sg_mc_ksm) @@ -90,10 +93,12 @@ RegionSnapshot dense_region( remote(permanent_addr), simgrid::mc::ProcessIndexDisabled); +#ifdef __linux__ if (_sg_mc_ksm) // Mark the region as mergeable *after* we have written into it. // Trying to merge them before is useless/counterproductive. madvise(data.get(), size, MADV_MERGEABLE); +#endif simgrid::mc::RegionSnapshot region( region_type, start_addr, permanent_addr, size); @@ -123,7 +128,7 @@ RegionSnapshot region( RegionSnapshot sparse_region(RegionType region_type, void *start_addr, void* permanent_addr, size_t size) { - simgrid::mc::Process* process = &mc_model_checker->process(); + simgrid::mc::RemoteClient* process = &mc_model_checker->process(); assert(process != nullptr); xbt_assert((((uintptr_t)start_addr) & (xbt_pagesize-1)) == 0, @@ -140,6 +145,6 @@ RegionSnapshot sparse_region(RegionType region_type, region.page_data(std::move(page_data)); return region; } - + } }