vm_pageout.c (117303) | vm_pageout.c (118390) |
---|---|
1/* 2 * Copyright (c) 1991 Regents of the University of California. 3 * All rights reserved. 4 * Copyright (c) 1994 John S. Dyson 5 * All rights reserved. 6 * Copyright (c) 1994 David Greenman 7 * All rights reserved. 8 * --- 57 unchanged lines hidden (view full) --- 66 * rights to redistribute these changes. 67 */ 68 69/* 70 * The proverbial page-out daemon. 71 */ 72 73#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1991 Regents of the University of California. 3 * All rights reserved. 4 * Copyright (c) 1994 John S. Dyson 5 * All rights reserved. 6 * Copyright (c) 1994 David Greenman 7 * All rights reserved. 8 * --- 57 unchanged lines hidden (view full) --- 66 * rights to redistribute these changes. 67 */ 68 69/* 70 * The proverbial page-out daemon. 71 */ 72 73#include <sys/cdefs.h> |
74__FBSDID("$FreeBSD: head/sys/vm/vm_pageout.c 117303 2003-07-07 07:16:29Z alc $"); | 74__FBSDID("$FreeBSD: head/sys/vm/vm_pageout.c 118390 2003-08-03 13:35:31Z phk $"); |
75 76#include "opt_vm.h" 77#include <sys/param.h> 78#include <sys/systm.h> 79#include <sys/kernel.h> 80#include <sys/eventhandler.h> 81#include <sys/lock.h> 82#include <sys/mutex.h> --- 1106 unchanged lines hidden (view full) --- 1189 * We keep the process bigproc locked once we find it to keep anyone 1190 * from messing with it; however, there is a possibility of 1191 * deadlock if process B is bigproc and one of it's child processes 1192 * attempts to propagate a signal to B while we are waiting for A's 1193 * lock while walking this list. To avoid this, we don't block on 1194 * the process lock but just skip a process if it is already locked. 1195 */ 1196 if (pass != 0 && | 75 76#include "opt_vm.h" 77#include <sys/param.h> 78#include <sys/systm.h> 79#include <sys/kernel.h> 80#include <sys/eventhandler.h> 81#include <sys/lock.h> 82#include <sys/mutex.h> --- 1106 unchanged lines hidden (view full) --- 1189 * We keep the process bigproc locked once we find it to keep anyone 1190 * from messing with it; however, there is a possibility of 1191 * deadlock if process B is bigproc and one of it's child processes 1192 * attempts to propagate a signal to B while we are waiting for A's 1193 * lock while walking this list. To avoid this, we don't block on 1194 * the process lock but just skip a process if it is already locked. 1195 */ 1196 if (pass != 0 && |
1197 ((vm_swap_size < 64 && vm_page_count_min()) || | 1197 ((swap_pager_avail < 64 && vm_page_count_min()) || |
1198 (swap_pager_full && vm_paging_target() > 0))) { 1199 bigproc = NULL; 1200 bigsize = 0; 1201 sx_slock(&allproc_lock); 1202 FOREACH_PROC_IN_SYSTEM(p) { 1203 int breakout; 1204 /* 1205 * If this process is already locked, skip it. 1206 */ 1207 if (PROC_TRYLOCK(p) == 0) 1208 continue; 1209 /* 1210 * If this is a system or protected process, skip it. 1211 */ 1212 if ((p->p_flag & P_SYSTEM) || (p->p_pid == 1) || 1213 (p->p_flag & P_PROTECTED) || | 1198 (swap_pager_full && vm_paging_target() > 0))) { 1199 bigproc = NULL; 1200 bigsize = 0; 1201 sx_slock(&allproc_lock); 1202 FOREACH_PROC_IN_SYSTEM(p) { 1203 int breakout; 1204 /* 1205 * If this process is already locked, skip it. 1206 */ 1207 if (PROC_TRYLOCK(p) == 0) 1208 continue; 1209 /* 1210 * If this is a system or protected process, skip it. 1211 */ 1212 if ((p->p_flag & P_SYSTEM) || (p->p_pid == 1) || 1213 (p->p_flag & P_PROTECTED) || |
1214 ((p->p_pid < 48) && (vm_swap_size != 0))) { | 1214 ((p->p_pid < 48) && (swap_pager_avail != 0))) { |
1215 PROC_UNLOCK(p); 1216 continue; 1217 } 1218 /* 1219 * if the process is in a non-running type state, 1220 * don't touch it. Check all the threads individually. 1221 */ 1222 mtx_lock_spin(&sched_lock); --- 394 unchanged lines hidden --- | 1215 PROC_UNLOCK(p); 1216 continue; 1217 } 1218 /* 1219 * if the process is in a non-running type state, 1220 * don't touch it. Check all the threads individually. 1221 */ 1222 mtx_lock_spin(&sched_lock); --- 394 unchanged lines hidden --- |