summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2015-03-21 17:56:55 +0000
committeralc <alc@FreeBSD.org>2015-03-21 17:56:55 +0000
commitb131a2abc80d9ea68d6ff41d2ab9bde70e6023d7 (patch)
tree165f4dc5d1f1dbe912f22d0117840f1b5a196514 /sys/kern/kern_exec.c
parent16676d0f06097d8080ec7a8136f25347f1653da7 (diff)
downloadFreeBSD-src-b131a2abc80d9ea68d6ff41d2ab9bde70e6023d7.zip
FreeBSD-src-b131a2abc80d9ea68d6ff41d2ab9bde70e6023d7.tar.gz
Introduce vm_object_color() and use it in mmap(2) to set the color of
named objects to zero before the virtual address is selected. Previously, the color setting was delayed until after the virtual address was selected. In rtld, this delay effectively prevented the mapping of a shared library's code section using superpages. Now, for example, we see the first 1 MB of libc's code on armv6 mapped by a superpage after we've gotten through the initial cold misses that bring the first 1 MB of code into memory. (With the page clustering that we perform on read faults, this happens quickly.) Differential Revision: https://reviews.freebsd.org/D2013 Reviewed by: jhb, kib Tested by: Svatopluk Kraus (armv6) MFC after: 6 weeks
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 25335ce..388ed19 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -933,10 +933,7 @@ exec_map_first_page(imgp)
return (EACCES);
VM_OBJECT_WLOCK(object);
#if VM_NRESERVLEVEL > 0
- if ((object->flags & OBJ_COLORED) == 0) {
- object->flags |= OBJ_COLORED;
- object->pg_color = 0;
- }
+ vm_object_color(object, 0);
#endif
ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL);
if (ma[0]->valid != VM_PAGE_BITS_ALL) {
OpenPOWER on IntegriCloud