[MLton] Progress on AMD64/FreeBSD

Matthew Fluet fluet at tti-c.org
Sun Jun 24 05:28:23 PDT 2007


Jesper Louis Andersen wrote:
> Matthew is right, it doesn't cycle. I came to the same conclusion
> independently
> of him. What nags me however is that since we are not doing MAP_FIXED the
> location is a hint to the kernel. In principle the kernel is free to 
> provide
> us with
> any memory area where it can fit the mapping.

That appears to be how things work on linux.  There, we request an mmap 
at the address 0xf800000000000000 and are returned an mmap at the 
address 0x00002aaaaaab2000.

I thought that I read somewhere that mmap would return a higher addresss 
than the one requested, but not a lower address.  Maybe that is what is 
happening on FreeBSD.  It certainly isn't the case on Linux.

But, presumably, there was some reason to put in the scan through 
memory.  As Jesper notes, one expects that without MAP_FIXED, we should 
get back an address if there is enough space.

> I hope to get some time for investigating the coming days. There are a
> couple of
> rather loose ends to verify.
> 
> On 6/24/07, skaller <skaller at users.sourceforge.net> wrote:
>>
>> On Sat, 2007-06-23 at 19:57 -0500, Matthew Fluet wrote:
>> > Jesper Louis Andersen wrote:
>> > > ok, new hypothesis:
>> > >
>> > > printing the right size of the pointer gives
>> > >
>> > > Couldn't map f7ff9954b0000000, 94208
>> > >
>> > > etc. So I think this area is non-mappable for som reason. More
>> > > investigation
>> > > needed.
>> >
>> > It could be that FreeBSD just doesn't release the very high addresses
>> > for mmap'ing.  And it is just taking forever to work our way down to 
>> the
>> > available addresses.
>> >
>> > We'll want to increase the scan stride for a 64-bit system.
>>
>> I think on Linux, the whole upper half of the address space is reserved
>> for the kernel. [Still .. Mlton does work 64 bit on Ubuntu]
>> There are descriptions of the memory models somewhere.
>> To me this number: f7ff9954b0000000 looks like a stack address.
>> I don't really have any expertise though.
>>
>> -- 
>> John Skaller <skaller at users dot sf dot net>
>> Felix, successor to C++: http://felix.sf.net
>>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> MLton mailing list
> MLton at mlton.org
> http://mlton.org/mailman/listinfo/mlton




More information about the MLton mailing list