On Tue, Jul 19, 2016 at 3:58 AM, Antti Kantee <[email protected]> wrote: > 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. >
Cannot argue with that considering the use cases for the choice of rumprun definitely puts additional constraints on application design and deployment and probably rightfully so. > 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 ... > I believe you are correct but it does complicate the changes required in the Erlang package which as it appears favors Linux for its internal architecture. Having said that I do believe given sufficient publicity (to gain support within the Erlang maint community) and enhanced understanding should take care of some of that if not everything. -Neeraj
