xref: /freebsd/sys/vm/vm_pageout.h (revision ceb0cf87e893efc7331317d58fa5ddeadd8fa2a0)
1df8bae1dSRodney W. Grimes /*
2df8bae1dSRodney W. Grimes  * Copyright (c) 1991, 1993
3df8bae1dSRodney W. Grimes  *	The Regents of the University of California.  All rights reserved.
4df8bae1dSRodney W. Grimes  *
5df8bae1dSRodney W. Grimes  * This code is derived from software contributed to Berkeley by
6df8bae1dSRodney W. Grimes  * The Mach Operating System project at Carnegie-Mellon University.
7df8bae1dSRodney W. Grimes  *
8df8bae1dSRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
9df8bae1dSRodney W. Grimes  * modification, are permitted provided that the following conditions
10df8bae1dSRodney W. Grimes  * are met:
11df8bae1dSRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
12df8bae1dSRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
13df8bae1dSRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
14df8bae1dSRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
15df8bae1dSRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
16df8bae1dSRodney W. Grimes  * 3. All advertising materials mentioning features or use of this software
17df8bae1dSRodney W. Grimes  *    must display the following acknowledgement:
18df8bae1dSRodney W. Grimes  *	This product includes software developed by the University of
19df8bae1dSRodney W. Grimes  *	California, Berkeley and its contributors.
20df8bae1dSRodney W. Grimes  * 4. Neither the name of the University nor the names of its contributors
21df8bae1dSRodney W. Grimes  *    may be used to endorse or promote products derived from this software
22df8bae1dSRodney W. Grimes  *    without specific prior written permission.
23df8bae1dSRodney W. Grimes  *
24df8bae1dSRodney W. Grimes  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25df8bae1dSRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26df8bae1dSRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27df8bae1dSRodney W. Grimes  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28df8bae1dSRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29df8bae1dSRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30df8bae1dSRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31df8bae1dSRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32df8bae1dSRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33df8bae1dSRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34df8bae1dSRodney W. Grimes  * SUCH DAMAGE.
35df8bae1dSRodney W. Grimes  *
363c4dd356SDavid Greenman  *	from: @(#)vm_pageout.h	8.2 (Berkeley) 1/12/94
37df8bae1dSRodney W. Grimes  *
38df8bae1dSRodney W. Grimes  *
39df8bae1dSRodney W. Grimes  * Copyright (c) 1987, 1990 Carnegie-Mellon University.
40df8bae1dSRodney W. Grimes  * All rights reserved.
41df8bae1dSRodney W. Grimes  *
42df8bae1dSRodney W. Grimes  * Author: Avadis Tevanian, Jr.
43df8bae1dSRodney W. Grimes  *
44df8bae1dSRodney W. Grimes  * Permission to use, copy, modify and distribute this software and
45df8bae1dSRodney W. Grimes  * its documentation is hereby granted, provided that both the copyright
46df8bae1dSRodney W. Grimes  * notice and this permission notice appear in all copies of the
47df8bae1dSRodney W. Grimes  * software, derivative works or modified versions, and any portions
48df8bae1dSRodney W. Grimes  * thereof, and that both notices appear in supporting documentation.
49df8bae1dSRodney W. Grimes  *
50df8bae1dSRodney W. Grimes  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
51df8bae1dSRodney W. Grimes  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
52df8bae1dSRodney W. Grimes  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
53df8bae1dSRodney W. Grimes  *
54df8bae1dSRodney W. Grimes  * Carnegie Mellon requests users of this software to return to
55df8bae1dSRodney W. Grimes  *
56df8bae1dSRodney W. Grimes  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
57df8bae1dSRodney W. Grimes  *  School of Computer Science
58df8bae1dSRodney W. Grimes  *  Carnegie Mellon University
59df8bae1dSRodney W. Grimes  *  Pittsburgh PA 15213-3890
60df8bae1dSRodney W. Grimes  *
61df8bae1dSRodney W. Grimes  * any improvements or extensions that they make and grant Carnegie the
62df8bae1dSRodney W. Grimes  * rights to redistribute these changes.
633c4dd356SDavid Greenman  *
64ceb0cf87SJohn Dyson  * $Id: vm_pageout.h,v 1.20 1997/02/22 09:48:34 peter Exp $
65df8bae1dSRodney W. Grimes  */
66df8bae1dSRodney W. Grimes 
673301cc3cSPaul Richards #ifndef _VM_VM_PAGEOUT_H_
683301cc3cSPaul Richards #define _VM_VM_PAGEOUT_H_
693301cc3cSPaul Richards 
70df8bae1dSRodney W. Grimes /*
71df8bae1dSRodney W. Grimes  *	Header file for pageout daemon.
72df8bae1dSRodney W. Grimes  */
73df8bae1dSRodney W. Grimes 
74df8bae1dSRodney W. Grimes /*
75df8bae1dSRodney W. Grimes  *	Exported data structures.
76df8bae1dSRodney W. Grimes  */
77df8bae1dSRodney W. Grimes 
78b5e8ce9fSBruce Evans extern int vm_page_max_wired;
79df8bae1dSRodney W. Grimes extern int vm_pages_needed;	/* should be some "event" structure */
8026f9a767SRodney W. Grimes extern int vm_pageout_pages_needed;
81df8bae1dSRodney W. Grimes 
8226f9a767SRodney W. Grimes #define VM_PAGEOUT_ASYNC 0
8326f9a767SRodney W. Grimes #define VM_PAGEOUT_SYNC 1
8426f9a767SRodney W. Grimes #define VM_PAGEOUT_FORCE 2
85df8bae1dSRodney W. Grimes 
86df8bae1dSRodney W. Grimes /*
87ceb0cf87SJohn Dyson  * Swap out requests
88ceb0cf87SJohn Dyson  */
89ceb0cf87SJohn Dyson #define VM_SWAP_NORMAL 1
90ceb0cf87SJohn Dyson #define VM_SWAP_IDLE 2
91ceb0cf87SJohn Dyson 
92ceb0cf87SJohn Dyson /*
93df8bae1dSRodney W. Grimes  *	Exported routines.
94df8bae1dSRodney W. Grimes  */
95df8bae1dSRodney W. Grimes 
96df8bae1dSRodney W. Grimes /*
97df8bae1dSRodney W. Grimes  *	Signal pageout-daemon and wait for it.
98df8bae1dSRodney W. Grimes  */
99df8bae1dSRodney W. Grimes 
100e0c5a895SJohn Dyson extern void pagedaemon_wakeup __P((void));
10126f9a767SRodney W. Grimes #define VM_WAIT vm_wait()
102e0c5a895SJohn Dyson extern void vm_wait __P((void));
10326f9a767SRodney W. Grimes 
104df8bae1dSRodney W. Grimes #ifdef KERNEL
105df8bae1dSRodney W. Grimes void vm_pageout_page __P((vm_page_t, vm_object_t));
106df8bae1dSRodney W. Grimes void vm_pageout_cluster __P((vm_page_t, vm_object_t));
107aef922f5SJohn Dyson int vm_pageout_flush __P((vm_page_t *, int, int));
1080d94caffSDavid Greenman 
109df8bae1dSRodney W. Grimes #endif
1103301cc3cSPaul Richards 
1113301cc3cSPaul Richards #endif
112