summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2007-12-29 19:53:04 +0000
committeralc <alc@FreeBSD.org>2007-12-29 19:53:04 +0000
commit4565fa16977a4fac5f98cb75e9f5559d67c6446f (patch)
tree53711ee4be0bb0ef15bc2d3bbc2d1e3908061be8 /sys/kern/kern_exec.c
parentcfcf7dfc62d30c66adf52384e97d4157bab82146 (diff)
downloadFreeBSD-src-4565fa16977a4fac5f98cb75e9f5559d67c6446f.zip
FreeBSD-src-4565fa16977a4fac5f98cb75e9f5559d67c6446f.tar.gz
Add the superpage reservation system. This is "part 2 of 2" of the
machine-independent support for superpages. (The earlier part was the rewrite of the physical memory allocator.) The remainder of the code required for superpages support is machine-dependent and will be added to the various pmap implementations at a later date. Initially, I am only supporting one large page size per architecture. Moreover, I am only enabling the reservation system on amd64. (In an emergency, it can be disabled by setting VM_NRESERVLEVELS to 0 in amd64/include/vmparam.h or your kernel configuration file.)
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 2878b37..b0a8dcc 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$");
#include "opt_hwpmc_hooks.h"
#include "opt_ktrace.h"
#include "opt_mac.h"
+#include "opt_vm.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -820,6 +821,12 @@ exec_map_first_page(imgp)
if (object == NULL)
return (EACCES);
VM_OBJECT_LOCK(object);
+#if VM_NRESERVLEVEL > 0
+ if ((object->flags & OBJ_COLORED) == 0) {
+ object->flags |= OBJ_COLORED;
+ object->pg_color = 0;
+ }
+#endif
ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
if ((ma[0]->valid & VM_PAGE_BITS_ALL) != VM_PAGE_BITS_ALL) {
initial_pagein = VM_INITIAL_PAGEIN;
OpenPOWER on IntegriCloud