PCH support on Solaris
Sat Apr 5 08:17:00 GMT 2003
> I don't think this is a performance issue, but a correctness issue.
Don't forget that we're only talking about heuristics, so it's fine if it
> However, if you do not use MAP_FIXED, the OS will treat the address
> parameter as merely a hint, which it is free to ignore completely
> -- and in fact this is what in my experience (at least some versions)
> of Solaris tend to do.
I've attached a little test program that exercices Paolo's solution:
- we first ask mmap for the preferred location by passing NULL,
- then we pass it this preferred location with a zero offset.
We do so for sizes up to 1GB.
Tested on Solaris/Sparc 2.5.1, 2.6, 2.7, 2.8, 2.9, all clear.
> So it is easily possible that this mmap will always succeed, but never
> return guess == mmi.preferred_base. Using MAP_FIXED subsequently with the
> address guess doesn't then buy you anything ...
Note that, in the patch I posted, I explicitly check that we have the
equality guess == mmi.preferred_base. And, according to the little test
program, this seems to be true:
- if mmi.preferred_base is the preferred address returned by mmap(NULL, ...)
- and the offset is zero.
> This is why I don't quite see what the benefit of this mmap is
> supposed to be.
We work around the dependency upon the offset, which seems to be a feature of
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1830 bytes
Desc: not available
More information about the Gcc-patches