mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
Fixed breakage of the !SMP case of roundrobin() in the previous commit.
This commit is contained in:
parent
65baf8f06b
commit
c8a1bed2ab
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=40652
@ -36,7 +36,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)kern_synch.c 8.9 (Berkeley) 5/19/95
|
* @(#)kern_synch.c 8.9 (Berkeley) 5/19/95
|
||||||
* $Id: kern_synch.c,v 1.62 1998/08/26 05:27:42 dillon Exp $
|
* $Id: kern_synch.c,v 1.63 1998/10/25 17:44:51 phk Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "opt_ktrace.h"
|
#include "opt_ktrace.h"
|
||||||
@ -138,6 +138,9 @@ static void
|
|||||||
roundrobin(arg)
|
roundrobin(arg)
|
||||||
void *arg;
|
void *arg;
|
||||||
{
|
{
|
||||||
|
#ifndef SMP
|
||||||
|
struct proc *p = curproc; /* XXX */
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef SMP
|
#ifdef SMP
|
||||||
need_resched();
|
need_resched();
|
||||||
@ -290,7 +293,7 @@ schedcpu(arg)
|
|||||||
#define PPQ (128 / NQS) /* priorities per queue */
|
#define PPQ (128 / NQS) /* priorities per queue */
|
||||||
if ((p != curproc) &&
|
if ((p != curproc) &&
|
||||||
#ifdef SMP
|
#ifdef SMP
|
||||||
(u_char)p->p_oncpu == 0xff && /* idle */
|
p->p_oncpu == 0xff && /* idle */
|
||||||
#endif
|
#endif
|
||||||
p->p_stat == SRUN &&
|
p->p_stat == SRUN &&
|
||||||
(p->p_flag & P_INMEM) &&
|
(p->p_flag & P_INMEM) &&
|
||||||
@ -632,7 +635,7 @@ mi_switch()
|
|||||||
|
|
||||||
#ifdef SIMPLELOCK_DEBUG
|
#ifdef SIMPLELOCK_DEBUG
|
||||||
if (p->p_simple_locks)
|
if (p->p_simple_locks)
|
||||||
printf("sleep: holding simple lock\n");
|
Debugger("sleep: holding simple lock\n");
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* Compute the amount of time during which the current
|
* Compute the amount of time during which the current
|
||||||
@ -648,9 +651,9 @@ mi_switch()
|
|||||||
*/
|
*/
|
||||||
if (p->p_stat != SZOMB && p->p_runtime > p->p_limit->p_cpulimit) {
|
if (p->p_stat != SZOMB && p->p_runtime > p->p_limit->p_cpulimit) {
|
||||||
rlim = &p->p_rlimit[RLIMIT_CPU];
|
rlim = &p->p_rlimit[RLIMIT_CPU];
|
||||||
if (p->p_runtime / (rlim_t)1000000 >= rlim->rlim_max) {
|
if (p->p_runtime / 1000000 >= rlim->rlim_max)
|
||||||
killproc(p, "exceeded maximum CPU limit");
|
killproc(p, "exceeded maximum CPU limit");
|
||||||
} else {
|
else {
|
||||||
psignal(p, SIGXCPU);
|
psignal(p, SIGXCPU);
|
||||||
if (rlim->rlim_cur < rlim->rlim_max) {
|
if (rlim->rlim_cur < rlim->rlim_max) {
|
||||||
/* XXX: we should make a private copy */
|
/* XXX: we should make a private copy */
|
||||||
|
Loading…
Reference in New Issue
Block a user