Muli Ben-Yehuda's journal

January 5, 2005

Andrew Morton explains flex-mmap

Filed under: Uncategorized — Muli Ben-Yehuda @ 10:45 AM

Andrew Morton explains flex-mmap in “Re: ptrace single-stepping change breaks Wine” on lkml. Makes a lot of sense when you put it this way. The only downside is that some applications expect the old binary layout and break with the new one.

the ‘after’ layout guarantees that brk area (malloc()) can grow unlimited and mmap() can grow unlimited – they will meet somewhere inbetween when almost all of the VM is used up. [the ‘top’ of the mmaps in the ‘after’ layout is constrained by the stack ulimit – the stack must still fit and we never allocate into the stack’s yet unallocated and growable hole.]

with the ‘before’ layout we’ve got 900 MB for brk() and 1.9GB for mmaps() – a rigid limit.


  1. The question is, does the new interface make sure that the old applications have no way of using it by mistake.

    Comment by ladypine — January 5, 2005 @ 4:01 PM | Reply

    • it’s not really an interface, it’s the binary layout in virtual memory. The linker / loader gives you one or the other. Do you mean the application needs a way to know which layout it’s using?

      Comment by mulix — January 5, 2005 @ 4:11 PM | Reply

      • I mean there must never be a situation in which a program is running, but it does the wrong thing, because it uses the old standard.
        No results are OK, wrong results are, well, wrong.
        If it does not link, it is fine with me.
        What about dynamically linked programs? Will the stop working and give a linker error? Or will they start running, and crash out of the blue?

        Comment by ladypine — January 5, 2005 @ 4:43 PM

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at

%d bloggers like this: