kern_synch.c (c21410e1192bfc47a8bca3ca72ee8ff726bffa4c) | kern_synch.c (2f1e70693d5139b207a083e6a7255871ef15cdeb) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1990, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)kern_synch.c 8.9 (Berkeley) 5/19/95 | 1/*- 2 * Copyright (c) 1982, 1986, 1990, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)kern_synch.c 8.9 (Berkeley) 5/19/95 |
39 * $Id: kern_synch.c,v 1.54 1998/04/04 13:25:20 phk Exp $ | 39 * $Id: kern_synch.c,v 1.55 1998/05/17 11:52:45 phk Exp $ |
40 */ 41 42#include "opt_ktrace.h" 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/proc.h> 47#include <sys/kernel.h> --- 4 unchanged lines hidden (view full) --- 52#include <vm/vm.h> 53#include <vm/vm_extern.h> 54#ifdef KTRACE 55#include <sys/uio.h> 56#include <sys/ktrace.h> 57#endif 58 59#include <machine/cpu.h> | 40 */ 41 42#include "opt_ktrace.h" 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/proc.h> 47#include <sys/kernel.h> --- 4 unchanged lines hidden (view full) --- 52#include <vm/vm.h> 53#include <vm/vm_extern.h> 54#ifdef KTRACE 55#include <sys/uio.h> 56#include <sys/ktrace.h> 57#endif 58 59#include <machine/cpu.h> |
60#ifdef SMP 61#include <machine/smp.h> 62#endif 63#include <machine/ipl.h> |
|
60#include <machine/limits.h> /* for UCHAR_MAX = typeof(p_priority)_MAX */ 61 62static void rqinit __P((void *)); 63SYSINIT(runqueue, SI_SUB_RUN_QUEUE, SI_ORDER_FIRST, rqinit, NULL) 64 65u_char curpriority; /* usrpri of curproc */ 66int lbolt; /* once a second sleep address */ 67 --- 57 unchanged lines hidden (view full) --- 125 */ 126/* ARGSUSED */ 127static void 128roundrobin(arg) 129 void *arg; 130{ 131 struct proc *p = curproc; /* XXX */ 132 | 64#include <machine/limits.h> /* for UCHAR_MAX = typeof(p_priority)_MAX */ 65 66static void rqinit __P((void *)); 67SYSINIT(runqueue, SI_SUB_RUN_QUEUE, SI_ORDER_FIRST, rqinit, NULL) 68 69u_char curpriority; /* usrpri of curproc */ 70int lbolt; /* once a second sleep address */ 71 --- 57 unchanged lines hidden (view full) --- 129 */ 130/* ARGSUSED */ 131static void 132roundrobin(arg) 133 void *arg; 134{ 135 struct proc *p = curproc; /* XXX */ 136 |
137#ifdef SMP 138 need_resched(); 139 forward_roundrobin(); 140#else |
|
133 if (p == 0 || RTP_PRIO_NEED_RR(p->p_rtprio.type)) 134 need_resched(); | 141 if (p == 0 || RTP_PRIO_NEED_RR(p->p_rtprio.type)) 142 need_resched(); |
143#endif |
|
135 136 timeout(roundrobin, NULL, ROUNDROBIN_INTERVAL); 137} 138 139/* 140 * Constants for digital decay and forget: 141 * 90% of (p_estcpu) usage in 5 * loadav time 142 * 95% of (p_pctcpu) usage in 60 seconds (load insensitive) --- 614 unchanged lines hidden --- | 144 145 timeout(roundrobin, NULL, ROUNDROBIN_INTERVAL); 146} 147 148/* 149 * Constants for digital decay and forget: 150 * 90% of (p_estcpu) usage in 5 * loadav time 151 * 95% of (p_pctcpu) usage in 60 seconds (load insensitive) --- 614 unchanged lines hidden --- |