mmap address allocation

From: John Birrell (jb_at_cimlogic.com.au)
Date: 06/18/04

  • Next message: Radim Kolar: "Re: fflush() on readonly files"
    Date: Fri, 18 Jun 2004 10:41:59 +1000
    To: arch@freebsd.org
    
    

    The current Wine code won't run on either FreeBSD4 or -current now that they've
    added code that tries to snaffle (mmap) all memory in user space from 0x80000000
    up. They do this because Windows 9x uses that area as a shared heap. The snaffle
    takes place as early as they can, before they start loading libraries like ntdll
    and kernel32.

    The FreeBSD mmap address allocation in the case where no address hint is provided,
    always tries to allocate memory above all existing allocations. Obviously this
    fails when dlopen() tries to load another shared library.

    There is a comment in sys/vm/vm_mmap.c:mmap that mentions "There should really be
    a pmap call to determine a reasonable location".

    What are people's thoughts about implementing such a thing (and having it do a
    better job of choosing an address)?

    -- 
    John Birrell
    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
    

  • Next message: Radim Kolar: "Re: fflush() on readonly files"

    Relevant Pages

    • Re: [PATCH 1/2]: Fix BUG in cancel_dirty_pages on XFS
      ... will see _none_ of the write because the mmap write occurred during ... inode in the buffered I/O *writeback* path, we have to stop pages being ... filesystems in both locking and the way it treats the page cache. ... No, but the data _in memory_ will, and now when the direct read ...
      (Linux-Kernel)
    • Re: How process size is calculated? Is it always based on the current highest available address in m
      ... But allocations/deallocations with mmaps can eventually lead to non-continuously mmapped memory. ... Before mmap: ... UID PID PPID CPU PRI NI VSZ RSS MWCHAN STAT TT TIME COMMAND ...
      (freebsd-hackers)
    • Re: mmap failing with EINVAL inside valgrind
      ... POST++ tries to start the debugger... ... Why don't they just let the application load the file where mmap ... Moi, you might be right with the memory range, that's what I ... BTW can you find any REASON for the code to use a fixed map-adress? ...
      (comp.unix.programmer)
    • Re: How mmap spends memory
      ... I'm actually interested how does mmap() - munmap() works. ... When you mmapyou are assigning a segment of your process's virtual ... memory segment so that it can be used for other purposes. ...
      (comp.unix.programmer)
    • Re: mmap 2GB allocation limit on Win XP, 32-bits, Python 2.5.4
      ... limitations, and I don't recall what they are. ... did not increase the available memory as well. ... Being an ignorant of the inner details of the implementation of mmap, ... if the swapfile is already clogged with all the other ...
      (comp.lang.python)