swap_pager.c (68883) | swap_pager.c (68885) |
---|---|
1/* 2 * Copyright (c) 1998 Matthew Dillon, 3 * Copyright (c) 1994 John S. Dyson 4 * Copyright (c) 1990 University of Utah. 5 * Copyright (c) 1991, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by --- 50 unchanged lines hidden (view full) --- 59 * cycled (in a high-load system) by the pager. We also do on-the-fly 60 * removal of invalidated swap blocks when a page is destroyed 61 * or renamed. 62 * 63 * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$ 64 * 65 * @(#)swap_pager.c 8.9 (Berkeley) 3/21/94 66 * | 1/* 2 * Copyright (c) 1998 Matthew Dillon, 3 * Copyright (c) 1994 John S. Dyson 4 * Copyright (c) 1990 University of Utah. 5 * Copyright (c) 1991, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by --- 50 unchanged lines hidden (view full) --- 59 * cycled (in a high-load system) by the pager. We also do on-the-fly 60 * removal of invalidated swap blocks when a page is destroyed 61 * or renamed. 62 * 63 * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$ 64 * 65 * @(#)swap_pager.c 8.9 (Berkeley) 3/21/94 66 * |
67 * $FreeBSD: head/sys/vm/swap_pager.c 68883 2000-11-18 21:01:04Z dillon $ | 67 * $FreeBSD: head/sys/vm/swap_pager.c 68885 2000-11-18 23:06:26Z dillon $ |
68 */ 69 70#include <sys/param.h> 71#include <sys/systm.h> 72#include <sys/conf.h> 73#include <sys/kernel.h> 74#include <sys/proc.h> 75#include <sys/bio.h> 76#include <sys/buf.h> 77#include <sys/vnode.h> 78#include <sys/malloc.h> 79#include <sys/vmmeter.h> 80#include <sys/sysctl.h> 81#include <sys/blist.h> 82#include <sys/lock.h> | 68 */ 69 70#include <sys/param.h> 71#include <sys/systm.h> 72#include <sys/conf.h> 73#include <sys/kernel.h> 74#include <sys/proc.h> 75#include <sys/bio.h> 76#include <sys/buf.h> 77#include <sys/vnode.h> 78#include <sys/malloc.h> 79#include <sys/vmmeter.h> 80#include <sys/sysctl.h> 81#include <sys/blist.h> 82#include <sys/lock.h> |
83#include <sys/vmmeter.h> |
|
83 84#ifndef MAX_PAGEOUT_CLUSTER 85#define MAX_PAGEOUT_CLUSTER 16 86#endif 87 88#define SWB_NPAGES MAX_PAGEOUT_CLUSTER 89 90#include "opt_swap.h" --- 1523 unchanged lines hidden (view full) --- 1614 vm_page_flash(m); 1615 } 1616 } else { 1617 /* 1618 * For write success, clear the modify and dirty 1619 * status, then finish the I/O ( which decrements the 1620 * busy count and possibly wakes waiter's up ). 1621 */ | 84 85#ifndef MAX_PAGEOUT_CLUSTER 86#define MAX_PAGEOUT_CLUSTER 16 87#endif 88 89#define SWB_NPAGES MAX_PAGEOUT_CLUSTER 90 91#include "opt_swap.h" --- 1523 unchanged lines hidden (view full) --- 1615 vm_page_flash(m); 1616 } 1617 } else { 1618 /* 1619 * For write success, clear the modify and dirty 1620 * status, then finish the I/O ( which decrements the 1621 * busy count and possibly wakes waiter's up ). 1622 */ |
1622 vm_page_protect(m, VM_PROT_READ); | |
1623 pmap_clear_modify(m); 1624 vm_page_undirty(m); 1625 vm_page_io_finish(m); | 1623 pmap_clear_modify(m); 1624 vm_page_undirty(m); 1625 vm_page_io_finish(m); |
1626 if (!vm_page_count_severe() || !vm_page_try_to_cache(m)) 1627 vm_page_protect(m, VM_PROT_READ); |
|
1626 } 1627 } 1628 1629 /* 1630 * adjust pip. NOTE: the original parent may still have its own 1631 * pip refs on the object. 1632 */ 1633 --- 437 unchanged lines hidden --- | 1628 } 1629 } 1630 1631 /* 1632 * adjust pip. NOTE: the original parent may still have its own 1633 * pip refs on the object. 1634 */ 1635 --- 437 unchanged lines hidden --- |