1139825Simp/*- 21541Srgrimes * Copyright (c) 1991, 1993 31541Srgrimes * The Regents of the University of California. All rights reserved. 41541Srgrimes * 51541Srgrimes * This code is derived from software contributed to Berkeley by 61541Srgrimes * The Mach Operating System project at Carnegie-Mellon University. 71541Srgrimes * 81541Srgrimes * Redistribution and use in source and binary forms, with or without 91541Srgrimes * modification, are permitted provided that the following conditions 101541Srgrimes * are met: 111541Srgrimes * 1. Redistributions of source code must retain the above copyright 121541Srgrimes * notice, this list of conditions and the following disclaimer. 131541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 141541Srgrimes * notice, this list of conditions and the following disclaimer in the 151541Srgrimes * documentation and/or other materials provided with the distribution. 161541Srgrimes * 4. Neither the name of the University nor the names of its contributors 171541Srgrimes * may be used to endorse or promote products derived from this software 181541Srgrimes * without specific prior written permission. 191541Srgrimes * 201541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 211541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 221541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 231541Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 241541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 251541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 261541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 271541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 281541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 291541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 301541Srgrimes * SUCH DAMAGE. 311541Srgrimes * 321817Sdg * from: @(#)vm_pageout.h 8.2 (Berkeley) 1/12/94 331541Srgrimes * 341541Srgrimes * 351541Srgrimes * Copyright (c) 1987, 1990 Carnegie-Mellon University. 361541Srgrimes * All rights reserved. 371541Srgrimes * 381541Srgrimes * Author: Avadis Tevanian, Jr. 395455Sdg * 401541Srgrimes * Permission to use, copy, modify and distribute this software and 411541Srgrimes * its documentation is hereby granted, provided that both the copyright 421541Srgrimes * notice and this permission notice appear in all copies of the 431541Srgrimes * software, derivative works or modified versions, and any portions 441541Srgrimes * thereof, and that both notices appear in supporting documentation. 455455Sdg * 465455Sdg * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 475455Sdg * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 481541Srgrimes * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 495455Sdg * 501541Srgrimes * Carnegie Mellon requests users of this software to return to 511541Srgrimes * 521541Srgrimes * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 531541Srgrimes * School of Computer Science 541541Srgrimes * Carnegie Mellon University 551541Srgrimes * Pittsburgh PA 15213-3890 561541Srgrimes * 571541Srgrimes * any improvements or extensions that they make and grant Carnegie the 581541Srgrimes * rights to redistribute these changes. 591817Sdg * 6050477Speter * $FreeBSD: stable/10/sys/vm/vm_pageout.h 314664 2017-03-04 12:05:50Z avg $ 611541Srgrimes */ 621541Srgrimes 632177Spaul#ifndef _VM_VM_PAGEOUT_H_ 642177Spaul#define _VM_VM_PAGEOUT_H_ 652177Spaul 661541Srgrimes/* 671541Srgrimes * Header file for pageout daemon. 681541Srgrimes */ 691541Srgrimes 701541Srgrimes/* 711541Srgrimes * Exported data structures. 721541Srgrimes */ 731541Srgrimes 747090Sbdeextern int vm_page_max_wired; 755455Sdgextern int vm_pages_needed; /* should be some "event" structure */ 761549Srgrimesextern int vm_pageout_pages_needed; 7732702Sdysonextern int vm_pageout_deficit; 78114564Salcextern int vm_pageout_page_count; 791541Srgrimes 801541Srgrimes/* 8131563Sdyson * Swap out requests 8231563Sdyson */ 8331563Sdyson#define VM_SWAP_NORMAL 1 8431563Sdyson#define VM_SWAP_IDLE 2 8531563Sdyson 86183474Skib#define VM_OOM_MEM 1 87183474Skib#define VM_OOM_SWAPZ 2 88183474Skib 8931563Sdyson/* 90314664Savg * vm_lowmem flags. 91314664Savg */ 92314664Savg#define VM_LOW_KMEM 0x01 93314664Savg#define VM_LOW_PAGES 0x02 94314664Savg 95314664Savg/* 961541Srgrimes * Exported routines. 971541Srgrimes */ 981541Srgrimes 991541Srgrimes/* 1001541Srgrimes * Signal pageout-daemon and wait for it. 1011541Srgrimes */ 1021541Srgrimes 10392727Salfredextern void pagedaemon_wakeup(void); 1041549Srgrimes#define VM_WAIT vm_wait() 10590935Ssilby#define VM_WAITPFAULT vm_waitpfault() 10692727Salfredextern void vm_wait(void); 10792727Salfredextern void vm_waitpfault(void); 1081549Srgrimes 10955206Speter#ifdef _KERNEL 110233100Skibint vm_pageout_flush(vm_page_t *, int, int, int, int *, boolean_t *); 111238561Salcvoid vm_pageout_grow_cache(int, vm_paddr_t, vm_paddr_t); 112183474Skibvoid vm_pageout_oom(int shortage); 1131541Srgrimes#endif 11492029Seivind#endif /* _VM_VM_PAGEOUT_H_ */ 115