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



On 2022-02-18 01:05, Michael van Elst wrote:
bqt%softjar.se@localhost (Johnny Billquist) writes:

If it would ignore the hint, what's the point of the hint then?

With MAP_FIXED it must use the hint, without it's just a best effort
attempt.

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.

Which is what a hint of 0 should do. So I don't get that.
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.

Anyway, that's just my reflections/thoughts on it.

  Johnny

--
Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt%softjar.se@localhost             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol


Home | Main Index | Thread Index | Old Index