svn commit: r254430 - in head: lib/libc/sys sys/sys sys/vm usr.bin/kdump usr.bin/truss

John Baldwin jhb at freebsd.org
Fri Aug 16 21:25:03 UTC 2013


On Friday, August 16, 2013 5:13:55 pm John Baldwin wrote:
> Author: jhb
> Date: Fri Aug 16 21:13:55 2013
> New Revision: 254430
> URL: http://svnweb.freebsd.org/changeset/base/254430
> 
> Log:
>   Add new mmap(2) flags to permit applications to request specific virtual
>   address alignment of mappings.
>   - MAP_ALIGNED(n) requests a mapping aligned on a boundary of (1 << n).
>     Requests for n >= number of bits in a pointer or less than the size of
>     a page fail with EINVAL.  This matches the API provided by NetBSD.
>   - MAP_ALIGNED_SUPER is a special case of MAP_ALIGNED.  It can be used
>     to optimize the chances of using large pages.  By default it will align
>     the mapping on a large page boundary (the system is free to choose any
>     large page size to align to that seems best for the mapping request).
>     However, if the object being mapped is already using large pages, then
>     it will align the virtual mapping to match the existing large pages in
>     the object instead.
>   - Internally, VMFS_ALIGNED_SPACE is now renamed to VMFS_SUPER_SPACE, and
>     VMFS_ALIGNED_SPACE(n) is repurposed for specifying a specific alignment.
>     MAP_ALIGNED(n) maps to using VMFS_ALIGNED_SPACE(n), while
>     MAP_ALIGNED_SUPER maps to VMFS_SUPER_SPACE.
>   - mmap() of a device object now uses VMFS_OPTIMAL_SPACE rather than
>     explicitly using VMFS_SUPER_SPACE.  All device objects are forced to
>     use a specific color on creation, so VMFS_OPTIMAL_SPACE is effectively
>     equivalent.

Forgot to note:

- Handle MAP_PREFAULT_READ in kdump and truss.

Also, any awkwardness in the mmap(2) text is purely my fault and not Alan's.
We might tweak it further, but the code is tested and fully reviewed.

-- 
John Baldwin


More information about the svn-src-head mailing list