tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Hinted mmap(2) without MAP_FIXED can fail prematurely



bqt%softjar.se@localhost (Johnny Billquist) writes:

>Which then basically means that without MAP_FIXED, the hint don't really 
>mean anything? It will take whatever address it can come up with, no 
>matter what you put into the hint.

It still might reuse the address (or just a close address) for efficiency.


>With MAP_FIXED, the hint needs to be exactly on a page boundary, which 
>makes sense. Without MAP_FIXED, and with a hint, I would expect that 
>things like rounding the address to the proper alignment, and so on, 
>would be allowed, but not that it would just take any address. If I'm ok 
>with it taking any random address, then I shouldn't provide a hint.

Unfortunately it doesn't matter. Linux will try the hint (aligned to a page)
and fall back to an arbitrary address. Software relies on this.



Home | Main Index | Thread Index | Old Index