diff options
author | Alan Cox <alc@FreeBSD.org> | 2007-12-29 19:53:04 +0000 |
---|---|---|
committer | Alan Cox <alc@FreeBSD.org> | 2007-12-29 19:53:04 +0000 |
commit | f8a47341feed1a067229652b1ca2591e1e0223b6 (patch) | |
tree | 53711ee4be0bb0ef15bc2d3bbc2d1e3908061be8 /sys/vm/vm_fault.c | |
parent | 098ff746f83905315d1b87c3929e35f9469db293 (diff) | |
download | src-f8a47341feed1a067229652b1ca2591e1e0223b6.tar.gz src-f8a47341feed1a067229652b1ca2591e1e0223b6.zip |
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.)
Notes
Notes:
svn path=/head/; revision=174982
Diffstat (limited to 'sys/vm/vm_fault.c')
-rw-r--r-- | sys/vm/vm_fault.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 49a4077046a8..d2a82204b1ff 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -74,6 +74,8 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include "opt_vm.h" + #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -429,6 +431,13 @@ RetryFault:; */ fs.m = NULL; if (!vm_page_count_severe()) { +#if VM_NRESERVLEVEL > 0 + if ((fs.object->flags & OBJ_COLORED) == 0) { + fs.object->flags |= OBJ_COLORED; + fs.object->pg_color = atop(vaddr) - + fs.pindex; + } +#endif fs.m = vm_page_alloc(fs.object, fs.pindex, (fs.vp || fs.object->backing_object)? VM_ALLOC_NORMAL: VM_ALLOC_ZERO); } @@ -1107,6 +1116,10 @@ vm_fault_copy_entry(dst_map, src_map, dst_entry, src_entry) */ dst_object = vm_object_allocate(OBJT_DEFAULT, OFF_TO_IDX(dst_entry->end - dst_entry->start)); +#if VM_NRESERVLEVEL > 0 + dst_object->flags |= OBJ_COLORED; + dst_object->pg_color = atop(dst_entry->start); +#endif VM_OBJECT_LOCK(dst_object); dst_entry->object.vm_object = dst_object; |