P_NOLOAD + ULE = high load averages

Nikos Ntarmos ntarmos at ceid.upatras.gr
Tue Apr 20 17:32:18 PDT 2004


Hi all.

There was a thread on "unusually high load averages" when running
under sched_ule, which (afaik) came at an abrupt halt in January 2004.
Anyway, I've been looking at this thing lately and have come to
believe that "pagezero" is (one of) the culprit(s). IMO the source of
the problem lies in /sys/kern/sched_ule.c having no provision for
processes with P_NOLOAD set. With pagezero not running at PRI_ITHD,
kseq_load_{add,rem} count pagezero as oh-another-normal-process, thus
the "expected-plus-one" load reported in the above thread. The
attached diff should fix this (at least it has fixed it here --
running 5.2-CURRENT on a PCA56, just cvsup'ed from
cvsup.gr.freebsd.org). Could someone please review/commit the changes
or should I better send-pr it?

\n\n

-- 
 Nikos "Noth" Ntarmos    | < ntarmos at ceid dot upatras dot gr >
 NetCINS Lab. @ C.E.I.D. | [ http://{noth,p2p}.ceid.upatras.gr/ ]
 U. of Patras - Greece   | ( 38.2594N, 21.7428E ) ( 1024D / CF95160A )
-------------- next part --------------
--- sys/kern/sched_ule.c.orig   Wed Apr 21 03:10:29 2004
+++ sys/kern/sched_ule.c        Wed Apr 21 03:20:34 2004
@@ -357,7 +357,7 @@
        if (class == PRI_TIMESHARE)
                kseq->ksq_load_timeshare++;
        kseq->ksq_load++;
-       if (class != PRI_ITHD)
+       if (class != PRI_ITHD && (ke->ke_proc->p_flag & P_NOLOAD) == 0)
 #ifdef SMP
                kseq->ksq_group->ksg_load++;
 #else
@@ -380,7 +380,7 @@
        class = PRI_BASE(ke->ke_ksegrp->kg_pri_class);
        if (class == PRI_TIMESHARE)
                kseq->ksq_load_timeshare--;
-       if (class != PRI_ITHD)
+       if (class != PRI_ITHD  && (ke->ke_proc->p_flag & P_NOLOAD) == 0)
 #ifdef SMP
                kseq->ksq_group->ksg_load--;
 #else


More information about the freebsd-current mailing list