1/*- 2 * Copyright (c) 1991 Regents of the University of California. 3 * All rights reserved. 4 * Copyright (c) 1998 Matthew Dillon. All Rights Reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * The Mach Operating System project at Carnegie-Mellon University. 8 * --- 63 unchanged lines hidden (view full) --- 72 * 73 */ 74 75/* 76 * Resident memory management module. 77 */ 78 79#include <sys/cdefs.h> |
80__FBSDID("$FreeBSD: head/sys/vm/vm_page.c 237168 2012-06-16 18:56:19Z alc $"); |
81 82#include "opt_vm.h" 83 84#include <sys/param.h> 85#include <sys/systm.h> 86#include <sys/lock.h> 87#include <sys/kernel.h> 88#include <sys/limits.h> --- 836 unchanged lines hidden (view full) --- 925 */ 926 if (object->resident_page_count == 1 && object->type == OBJT_VNODE) 927 vhold((struct vnode *)object->handle); 928 929 /* 930 * Since we are inserting a new and possibly dirty page, 931 * update the object's OBJ_MIGHTBEDIRTY flag. 932 */ |
933 if (pmap_page_is_write_mapped(m)) |
934 vm_object_set_writeable_dirty(object); 935} 936 937/* 938 * vm_page_remove: 939 * NOTE: used by device pager as well -wfj 940 * 941 * Removes the given mem entry from the object/offset-page --- 1728 unchanged lines hidden (view full) --- 2670{ 2671 uintptr_t addr; 2672#if PAGE_SIZE < 16384 2673 int shift; 2674#endif 2675 2676 /* 2677 * If the object is locked and the page is neither VPO_BUSY nor |
2678 * write mapped, then the page's dirty field cannot possibly be |
2679 * set by a concurrent pmap operation. 2680 */ 2681 VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); |
2682 if ((m->oflags & VPO_BUSY) == 0 && !pmap_page_is_write_mapped(m)) |
2683 m->dirty &= ~pagebits; 2684 else { 2685 /* 2686 * The pmap layer can call vm_page_dirty() without 2687 * holding a distinguished lock. The combination of 2688 * the object's lock and an atomic operation suffice 2689 * to guarantee consistency of the page dirty field. 2690 * --- 411 unchanged lines hidden --- |