vm_zeroidle.c (153940) | vm_zeroidle.c (157815) |
---|---|
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 153940 2005-12-31 14:39:20Z netchild $"); | 36__FBSDID("$FreeBSD: head/sys/vm/vm_zeroidle.c 157815 2006-04-17 18:20:38Z jhb $"); |
37 38#include <opt_sched.h> 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/kernel.h> 43#include <sys/proc.h> 44#include <sys/vmmeter.h> --- 90 unchanged lines hidden (view full) --- 135 wakeup_needed = FALSE; 136 wakeup(&zero_state); 137 } 138} 139 140static void 141vm_pagezero(void __unused *arg) 142{ | 37 38#include <opt_sched.h> 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/kernel.h> 43#include <sys/proc.h> 44#include <sys/vmmeter.h> --- 90 unchanged lines hidden (view full) --- 135 wakeup_needed = FALSE; 136 wakeup(&zero_state); 137 } 138} 139 140static void 141vm_pagezero(void __unused *arg) 142{ |
143 struct thread *td; | |
144 | 143 |
145 td = curthread; | |
146 idlezero_enable = idlezero_enable_default; 147 148 for (;;) { 149 if (vm_page_zero_check()) { 150 vm_page_zero_idle(); 151#ifndef PREEMPTION 152 if (sched_runnable()) { 153 mtx_lock_spin(&sched_lock); 154 mi_switch(SW_VOL, NULL); 155 mtx_unlock_spin(&sched_lock); 156 } 157#endif 158 } else { 159 vm_page_lock_queues(); 160 wakeup_needed = TRUE; 161 msleep(&zero_state, &vm_page_queue_mtx, | 144 idlezero_enable = idlezero_enable_default; 145 146 for (;;) { 147 if (vm_page_zero_check()) { 148 vm_page_zero_idle(); 149#ifndef PREEMPTION 150 if (sched_runnable()) { 151 mtx_lock_spin(&sched_lock); 152 mi_switch(SW_VOL, NULL); 153 mtx_unlock_spin(&sched_lock); 154 } 155#endif 156 } else { 157 vm_page_lock_queues(); 158 wakeup_needed = TRUE; 159 msleep(&zero_state, &vm_page_queue_mtx, |
162 PDROP | td->td_priority, "pgzero", hz * 300); | 160 PDROP, "pgzero", hz * 300); |
163 } 164 } 165} 166 167static struct proc *pagezero_proc; 168 169static void 170pagezero_start(void __unused *arg) --- 22 unchanged lines hidden --- | 161 } 162 } 163} 164 165static struct proc *pagezero_proc; 166 167static void 168pagezero_start(void __unused *arg) --- 22 unchanged lines hidden --- |