spelling of desperate
[unix-history] / usr / src / sys / vm / vm_meter.c
index c4875c9..9c499c7 100644 (file)
@@ -1,4 +1,4 @@
-/*     vm_meter.c      3.3     %H%     */
+/*     vm_meter.c      3.6     %G%     */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -67,7 +67,7 @@ sched()
 {
        register struct proc *rp, *p, *inp;
        int outpri, inpri, rppri;
 {
        register struct proc *rp, *p, *inp;
        int outpri, inpri, rppri;
-       int sleeper, desparate, deservin, needs, divisor;
+       int sleeper, desperate, deservin, needs, divisor;
        register struct bigp *bp, *nbp;
        int biggot, gives;
 
        register struct bigp *bp, *nbp;
        int biggot, gives;
 
@@ -87,12 +87,12 @@ loop:
        p = 0;
        if (kmapwnt || (multprog > 1 && avefree < desfree &&
            (rate.v_pgin + rate.v_pgout > maxpgio || avefree < minfree))) {
        p = 0;
        if (kmapwnt || (multprog > 1 && avefree < desfree &&
            (rate.v_pgin + rate.v_pgout > maxpgio || avefree < minfree))) {
-               desparate = 1;
+               desperate = 1;
                goto hardswap;
        }
                goto hardswap;
        }
-       desparate = 0;
+       desperate = 0;
        /*
        /*
-        * Not desparate for core,
+        * Not desperate for core,
         * look for someone who deserves to be brought in.
         */
        outpri = -20000;
         * look for someone who deserves to be brought in.
         */
        outpri = -20000;
@@ -190,7 +190,7 @@ hardswap:
                if (rp->p_textp && rp->p_textp->x_flag&XLOCK)
                        continue;
                if (rp->p_slptime > maxslp &&
                if (rp->p_textp && rp->p_textp->x_flag&XLOCK)
                        continue;
                if (rp->p_slptime > maxslp &&
-                   (rp->p_stat==SSLEEP&&rp->p_pri>=PZERO||rp->p_stat==SSTOP)) {
+                   (rp->p_stat==SSLEEP&&rp->p_pri>PZERO||rp->p_stat==SSTOP)) {
                        if (sleeper < rp->p_slptime) {
                                p = rp;
                                sleeper = rp->p_slptime;
                        if (sleeper < rp->p_slptime) {
                                p = rp;
                                sleeper = rp->p_slptime;
@@ -229,17 +229,17 @@ hardswap:
                }
        }
        /*
                }
        }
        /*
-        * If we found a long-time sleeper, or we are desparate and
+        * If we found a long-time sleeper, or we are desperate and
         * found anyone to swap out, or if someone deserves to come
         * in and we didn't find a sleeper, but found someone who
         * has been in core for a reasonable length of time, then
         * we kick the poor luser out.
         */
         * found anyone to swap out, or if someone deserves to come
         * in and we didn't find a sleeper, but found someone who
         * has been in core for a reasonable length of time, then
         * we kick the poor luser out.
         */
-       if (sleeper || desparate && p || deservin && inpri > maxslp) {
+       if (sleeper || desperate && p || deservin && inpri > maxslp) {
                p->p_flag &= ~SLOAD;
                if (p->p_stat == SRUN)
                        remrq(p);
                p->p_flag &= ~SLOAD;
                if (p->p_stat == SRUN)
                        remrq(p);
-               if (desparate) {
+               if (desperate) {
                        /*
                         * Want to give this space to the rest of
                         * the processes in core so give them a chance
                        /*
                         * Want to give this space to the rest of
                         * the processes in core so give them a chance
@@ -375,12 +375,12 @@ next:
 
                        case SSLEEP:
                        case SSTOP:
 
                        case SSLEEP:
                        case SSTOP:
-                               if (p->p_pri < PZERO)
+                               if (p->p_pri <= PZERO)
                                        nrun++;
                                if (p->p_flag & SPAGE)
                                        total.t_pw++;
                                else if (p->p_flag & SLOAD) {
                                        nrun++;
                                if (p->p_flag & SPAGE)
                                        total.t_pw++;
                                else if (p->p_flag & SLOAD) {
-                                       if (p->p_pri < PZERO)
+                                       if (p->p_pri <= PZERO)
                                                total.t_dw++;
                                        else if (p->p_slptime < maxslp)
                                                total.t_sl++;
                                                total.t_dw++;
                                        else if (p->p_slptime < maxslp)
                                                total.t_sl++;