Re: [BUG] get_unmapped_area() change -> non booting machine

From: Linus Torvalds
Date: Thu Feb 12 2004 - 11:38:34 EST




On Thu, 12 Feb 2004, Ingo Molnar wrote:
>
> i've pasted the relevant glibc malloc code below - it does use mmap() as
> a fallback.
>
> why in this particular case it failed i dont know - i believe some
> _minimal_ brk space is supposed to be available though, so if you break
> mmap() to fill in the brk space then that might break glibc assumptions.

I really think that we should aim for "brk()" just working. It's often
faster than mmap, and it's one of those very basic things (ie we should
_not_ assume we have glibc and malloc(), and others may well want to use
brk() too).

For now, the fix is to just revert the change that triggered this. But in
the long run I'd like to make it less fragile without having magic special
cases.

One option is to mark the brk() VMA's as being grow-up (which they are),
and make get_unmapped_area() realize that it should avoid trying to
allocate just above grow-up segments or just below grow-down segments.
That's still something of a special case, but at least it's not "magic"
any more, now it's more of a "makes sense".

Hmm?

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/