summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_init.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2013-08-16 21:13:55 +0000
committerjhb <jhb@FreeBSD.org>2013-08-16 21:13:55 +0000
commit3bfcb89de4b7ac6c54e2affe99eccd1482eb4327 (patch)
tree7565121f7abca9570dd1e0d308a2dd838e3c735b /sys/vm/vm_init.c
parentefcf22ed8cf8c3e8d2e5fa37ae4c4a9935a3d597 (diff)
downloadFreeBSD-src-3bfcb89de4b7ac6c54e2affe99eccd1482eb4327.zip
FreeBSD-src-3bfcb89de4b7ac6c54e2affe99eccd1482eb4327.tar.gz
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. Reviewed by: alc MFC after: 1 month
Diffstat (limited to 'sys/vm/vm_init.c')
-rw-r--r--sys/vm/vm_init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/vm/vm_init.c b/sys/vm/vm_init.c
index b539f9d..7ab1ee0 100644
--- a/sys/vm/vm_init.c
+++ b/sys/vm/vm_init.c
@@ -112,7 +112,7 @@ kva_import(void *unused, vmem_size_t size, int flags, vmem_addr_t *addrp)
addr = vm_map_min(kernel_map);
result = vm_map_find(kernel_map, NULL, 0, &addr, size,
- VMFS_ALIGNED_SPACE, VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT);
+ VMFS_SUPER_SPACE, VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT);
if (result != KERN_SUCCESS)
return (ENOMEM);
OpenPOWER on IntegriCloud