Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102673228
D41397.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D41397.diff
View Options
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -2255,19 +2255,19 @@
/*
* vm_map_find_min() is a variant of vm_map_find() that takes an
- * additional parameter (min_addr) and treats the given address
- * (*addr) differently. Specifically, it treats *addr as a hint
+ * additional parameter ("default_addr") and treats the given address
+ * ("*addr") differently. Specifically, it treats "*addr" as a hint
* and not as the minimum address where the mapping is created.
*
* This function works in two phases. First, it tries to
* allocate above the hint. If that fails and the hint is
- * greater than min_addr, it performs a second pass, replacing
- * the hint with min_addr as the minimum address for the
+ * greater than "default_addr", it performs a second pass, replacing
+ * the hint with "default_addr" as the minimum address for the
* allocation.
*/
int
vm_map_find_min(vm_map_t map, vm_object_t object, vm_ooffset_t offset,
- vm_offset_t *addr, vm_size_t length, vm_offset_t min_addr,
+ vm_offset_t *addr, vm_size_t length, vm_offset_t default_addr,
vm_offset_t max_addr, int find_space, vm_prot_t prot, vm_prot_t max,
int cow)
{
@@ -2277,14 +2277,14 @@
hint = *addr;
if (hint == 0) {
cow |= MAP_NO_HINT;
- *addr = hint = min_addr;
+ *addr = hint = default_addr;
}
for (;;) {
rv = vm_map_find(map, object, offset, addr, length, max_addr,
find_space, prot, max, cow);
- if (rv == KERN_SUCCESS || min_addr >= hint)
+ if (rv == KERN_SUCCESS || default_addr >= hint)
return (rv);
- *addr = hint = min_addr;
+ *addr = hint = default_addr;
}
}
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -1555,7 +1555,7 @@
vm_prot_t maxprot, int flags, vm_object_t object, vm_ooffset_t foff,
boolean_t writecounted, struct thread *td)
{
- vm_offset_t max_addr;
+ vm_offset_t default_addr, max_addr;
int docow, error, findspace, rv;
bool curmap, fitit;
@@ -1630,10 +1630,16 @@
max_addr = MAP_32BIT_MAX_ADDR;
#endif
if (curmap) {
- rv = vm_map_find_min(map, object, foff, addr, size,
+ default_addr =
round_page((vm_offset_t)td->td_proc->p_vmspace->
- vm_daddr + lim_max(td, RLIMIT_DATA)), max_addr,
- findspace, prot, maxprot, docow);
+ vm_daddr + lim_max(td, RLIMIT_DATA));
+#ifdef MAP_32BIT
+ if ((flags & MAP_32BIT) != 0)
+ default_addr = 0;
+#endif
+ rv = vm_map_find_min(map, object, foff, addr, size,
+ default_addr, max_addr, findspace, prot, maxprot,
+ docow);
} else {
rv = vm_map_find(map, object, foff, addr, size,
max_addr, findspace, prot, maxprot, docow);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 4:32 PM (22 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14661424
Default Alt Text
D41397.diff (2 KB)
Attached To
Mode
D41397: vm: Fix address hints of 0 with MAP_32BIT
Attached
Detach File
Event Timeline
Log In to Comment