vm_page.c (228287) | vm_page.c (230623) |
---|---|
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> | 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 228287 2011-12-05 18:29:25Z alc $"); | 80__FBSDID("$FreeBSD: head/sys/vm/vm_page.c 230623 2012-01-27 20:18:31Z kmacy $"); |
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> --- 1211 unchanged lines hidden (view full) --- 1300 * 1301 * optional allocation flags: 1302 * VM_ALLOC_COUNT(number) the number of additional pages that the caller 1303 * intends to allocate 1304 * VM_ALLOC_IFCACHED return page only if it is cached 1305 * VM_ALLOC_IFNOTCACHED return NULL, do not reactivate if the page 1306 * is cached 1307 * VM_ALLOC_NOBUSY do not set the flag VPO_BUSY on the page | 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> --- 1211 unchanged lines hidden (view full) --- 1300 * 1301 * optional allocation flags: 1302 * VM_ALLOC_COUNT(number) the number of additional pages that the caller 1303 * intends to allocate 1304 * VM_ALLOC_IFCACHED return page only if it is cached 1305 * VM_ALLOC_IFNOTCACHED return NULL, do not reactivate if the page 1306 * is cached 1307 * VM_ALLOC_NOBUSY do not set the flag VPO_BUSY on the page |
1308 * VM_ALLOC_NODUMP do not include the page in a kernel core dump |
|
1308 * VM_ALLOC_NOOBJ page is not associated with an object and 1309 * should not have the flag VPO_BUSY set 1310 * VM_ALLOC_WIRED wire the allocated page 1311 * VM_ALLOC_ZERO prefer a zeroed page 1312 * 1313 * This routine may not sleep. 1314 */ 1315vm_page_t --- 108 unchanged lines hidden (view full) --- 1424 cnt.v_free_count--; 1425 } 1426 1427 /* 1428 * Only the PG_ZERO flag is inherited. The PG_CACHED or PG_FREE flag 1429 * must be cleared before the free page queues lock is released. 1430 */ 1431 flags = 0; | 1309 * VM_ALLOC_NOOBJ page is not associated with an object and 1310 * should not have the flag VPO_BUSY set 1311 * VM_ALLOC_WIRED wire the allocated page 1312 * VM_ALLOC_ZERO prefer a zeroed page 1313 * 1314 * This routine may not sleep. 1315 */ 1316vm_page_t --- 108 unchanged lines hidden (view full) --- 1425 cnt.v_free_count--; 1426 } 1427 1428 /* 1429 * Only the PG_ZERO flag is inherited. The PG_CACHED or PG_FREE flag 1430 * must be cleared before the free page queues lock is released. 1431 */ 1432 flags = 0; |
1433 if (req & VM_ALLOC_NODUMP) 1434 flags |= PG_NODUMP; |
|
1432 if (m->flags & PG_ZERO) { 1433 vm_page_zero_count--; 1434 if (req & VM_ALLOC_ZERO) 1435 flags = PG_ZERO; 1436 } 1437 m->flags = flags; 1438 mtx_unlock(&vm_page_queue_free_mtx); 1439 m->aflags = 0; --- 154 unchanged lines hidden (view full) --- 1594 return (NULL); 1595 1596 /* 1597 * Initialize the pages. Only the PG_ZERO flag is inherited. 1598 */ 1599 flags = 0; 1600 if ((req & VM_ALLOC_ZERO) != 0) 1601 flags = PG_ZERO; | 1435 if (m->flags & PG_ZERO) { 1436 vm_page_zero_count--; 1437 if (req & VM_ALLOC_ZERO) 1438 flags = PG_ZERO; 1439 } 1440 m->flags = flags; 1441 mtx_unlock(&vm_page_queue_free_mtx); 1442 m->aflags = 0; --- 154 unchanged lines hidden (view full) --- 1597 return (NULL); 1598 1599 /* 1600 * Initialize the pages. Only the PG_ZERO flag is inherited. 1601 */ 1602 flags = 0; 1603 if ((req & VM_ALLOC_ZERO) != 0) 1604 flags = PG_ZERO; |
1605 if ((req & VM_ALLOC_NODUMP) != 0) 1606 flags |= PG_NODUMP; |
|
1602 if ((req & VM_ALLOC_WIRED) != 0) 1603 atomic_add_int(&cnt.v_wire_count, npages); 1604 oflags = VPO_UNMANAGED; 1605 if (object != NULL) { 1606 if ((req & VM_ALLOC_NOBUSY) == 0) 1607 oflags |= VPO_BUSY; 1608 if (object->memattr != VM_MEMATTR_DEFAULT && 1609 memattr == VM_MEMATTR_DEFAULT) --- 1422 unchanged lines hidden --- | 1607 if ((req & VM_ALLOC_WIRED) != 0) 1608 atomic_add_int(&cnt.v_wire_count, npages); 1609 oflags = VPO_UNMANAGED; 1610 if (object != NULL) { 1611 if ((req & VM_ALLOC_NOBUSY) == 0) 1612 oflags |= VPO_BUSY; 1613 if (object->memattr != VM_MEMATTR_DEFAULT && 1614 memattr == VM_MEMATTR_DEFAULT) --- 1422 unchanged lines hidden --- |