Subject: [Fwd: load calculation]
To: None <tech-kern@netbsd.org>
From: Lars Heidieker <lars@heidieker.de>
List: tech-kern
Date: 04/11/2005 16:05:24
This is a multi-part message in MIME format.
--------------050801090002010403010903
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Any Ideas not including aiodone is a hack.

        case LSSLEEP:
            if (l->l_priority > PZERO || l->l_slptime > 1)
                continue;
is there just to add io blocked lwp to the load, but aiodone allway 
sleeps with l_priority < PZERO.


/*
 * uvm_loadav: compute a tenex style load average of a quantity on
 * 1, 5, and 15 minute internvals.
 */
static void
uvm_loadav(avg)
    struct loadavg *avg;
{
    int i, nrun;
    struct lwp *l;

    proclist_lock_read();
    nrun = 0;
    LIST_FOREACH(l, &alllwp, l_list) {
        switch (l->l_stat) {
        case LSSLEEP:
            if (l->l_priority > PZERO || l->l_slptime > 1)
                continue;
        /* fall through */
        case LSRUN:
        case LSONPROC:
        case LSIDL:
            nrun++;
        }
    }
    proclist_unlock_read();
    for (i = 0; i < 3; i++)
        avg->ldavg[i] = (cexp[i] * avg->ldavg[i] +
            nrun * FSCALE * (FSCALE - cexp[i])) >> FSHIFT;
}


--------------050801090002010403010903
Content-Type: message/rfc822;
 name="load calculation"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="load calculation"

	by p15167860.pureserver.info (Postfix) with ESMTP id D780A80A0F9
	for <lars@heidieker.de>; Sat,  9 Apr 2005 12:00:42 +0200 (CEST)
	id BE07751B7; Sat,  9 Apr 2005 10:00:27 +0000 (UTC)
	by mail.netbsd.org (Postfix) with ESMTP id 20B67516D
	for <current-users@NetBSD.org>; Sat,  9 Apr 2005 10:00:26 +0000 (UTC)
	by p15167860.pureserver.info (Postfix) with ESMTP id A764880A0F9
	for <current-users@NetBSD.org>; Sat,  9 Apr 2005 12:00:24 +0200 (CEST)
Message-ID: <42578B98.4020401@heidieker.de>
Date: Sat, 09 Apr 2005 10:00:24 +0200
From: Lars Heidieker <lars@heidieker.de>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
MIME-Version: 1.0
To: current-users@NetBSD.org
Subject: load calculation
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Sender: current-users-owner@NetBSD.org
	p15167860.pureserver.info
	version=2.64

Hi,

the loadavg is almost to high, the problem is the aiodone daemon 
sleeping with l_priority < PZERO.
I think the aiodone daemon should not be acounted for by the loadavg 
calculation.
Or can it sleep with l_priority == PZERO

---
Lars



--------------050801090002010403010903--