Why max mmap size limited to half of virtual address space?

Anton Yuzhaninov citrin at citrin.ru
Mon Mar 12 10:33:14 UTC 2007


Hello,

Why  max mmap size limited to half virtual address space?
On i386 it limited to 2 Gb:

/sys/vm/vm_mmap.c

      /* make sure mapping fits into numeric range etc */
        if ((ssize_t) uap->len < 0 ||
            ((flags & MAP_ANON) && uap->fd != -1))
                return (EINVAL);


(ssize_t) uap->len < 0
limit maximum value for uap->len to SIZE_T_MAX/2

May be this check can be removed?

It test it on FreeBSD 6.2 i386 - without this check a can map 2400 Mb
file.

Also mmap man page say, that 2 Gb limit was a documentation bug, but this
limit still exist on i386.

-- 
 Anton Yuzhaninov.



More information about the freebsd-hackers mailing list