Bug 115371

Summary: `mmap` does not search for nearby addresses if the requested address is taken
Product: Memory Management Reporter: demetriobenour
Component: OtherAssignee: Andrew Morton (akpm)
Status: NEW ---    
Severity: normal CC: thomas.pi
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.5 Subsystem:
Regression: No Bisected commit-id:

Description demetriobenour 2016-03-28 01:47:58 UTC
According to https://github.com/LuaJIT/LuaJIT/issues/49, if the address passed to mmap(2) is already in use, it is ignored.  This breaks SpiderMonkey and LuaJIT, forcing an ugly workaround (essentially: do the search in userspace), which is racy and slow.

It would be nice to implement the search for a nearby usable address in the kernel.