Deleted Added
full compact
vm_zeroidle.c (131473) vm_zeroidle.c (131481)
1/*-
2 * Copyright (c) 1994 John Dyson
3 * Copyright (c) 2001 Matt Dillon
4 *
5 * All Rights Reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 19 unchanged lines hidden (view full) ---

28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 *
30 * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
31 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
32 * from: FreeBSD: .../i386/vm_machdep.c,v 1.165 2001/07/04 23:27:04 dillon
33 */
34
35#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1994 John Dyson
3 * Copyright (c) 2001 Matt Dillon
4 *
5 * All Rights Reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 19 unchanged lines hidden (view full) ---

28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 *
30 * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
31 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
32 * from: FreeBSD: .../i386/vm_machdep.c,v 1.165 2001/07/04 23:27:04 dillon
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/vm/vm_zeroidle.c 131473 2004-07-02 19:09:50Z jhb $");
36__FBSDID("$FreeBSD: head/sys/vm/vm_zeroidle.c 131481 2004-07-02 20:21:44Z jhb $");
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/kernel.h>
41#include <sys/proc.h>
42#include <sys/resourcevar.h>
43#include <sys/vmmeter.h>
44#include <sys/lock.h>

--- 101 unchanged lines hidden (view full) ---

146 mtx_lock_spin(&sched_lock);
147 rtp_to_pri(&rtp, td->td_ksegrp);
148 pri = td->td_priority;
149 mtx_unlock_spin(&sched_lock);
150
151 for (;;) {
152 if (vm_page_zero_check()) {
153 pages += vm_page_zero_idle();
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/kernel.h>
41#include <sys/proc.h>
42#include <sys/resourcevar.h>
43#include <sys/vmmeter.h>
44#include <sys/lock.h>

--- 101 unchanged lines hidden (view full) ---

146 mtx_lock_spin(&sched_lock);
147 rtp_to_pri(&rtp, td->td_ksegrp);
148 pri = td->td_priority;
149 mtx_unlock_spin(&sched_lock);
150
151 for (;;) {
152 if (vm_page_zero_check()) {
153 pages += vm_page_zero_idle();
154#ifndef PREEMPTION
154 if (pages > idlezero_maxrun || sched_runnable()) {
155 mtx_lock_spin(&sched_lock);
156 mi_switch(SW_VOL, NULL);
157 mtx_unlock_spin(&sched_lock);
158 pages = 0;
159 }
155 if (pages > idlezero_maxrun || sched_runnable()) {
156 mtx_lock_spin(&sched_lock);
157 mi_switch(SW_VOL, NULL);
158 mtx_unlock_spin(&sched_lock);
159 pages = 0;
160 }
161#endif
160 } else {
161 tsleep(&zero_state, pri, "pgzero", hz * 300);
162 pages = 0;
163 }
164 }
165}
166
167static struct proc *pagezero_proc;

--- 21 unchanged lines hidden ---
162 } else {
163 tsleep(&zero_state, pri, "pgzero", hz * 300);
164 pages = 0;
165 }
166 }
167}
168
169static struct proc *pagezero_proc;

--- 21 unchanged lines hidden ---