On 18/07/16 07:02, Neeraj Sharma wrote:
The application (Erlang) now uses mmap as follows:mmap(ptr, size, prot, MAP_ANON | MAP_PRIVATE | MAP_FIXED, ERTS_MMAP_FD, 0); The method sys_mmap clearly do not support MAP_FIXED at this point and hence the application fails. I am looking for background around the approach taken by rumprun in this case and any additional pointers to possible solutions in case this is not a philosophical discussion.
The approach, that many applications which want to do their own memory management do, is to map a huge chunk of VA with MAP_NORESERVE, and then map "known available" pieces from it using MAP_FIXED.
While there's no reason that the Rumprun page allocator could not support MAP_FIXED, without virtual memory it's sort of pointless, because you essentially need to allocate the physical memory to guarantee that the address is available. So, once you allocate the PA for MAP_"NO"RESERVE, MAP_FIXED is a nop anyway.
Maybe Rumprun needs virtual memory (shouldn't be too many days of hacking), but then again maybe it also needs SMP (which shouldn't be too many days either). I'm still not convinced that either is what is *really* needed; "if you want Linux", and all that. Given the dictionary definition of philosophy ...
