[Linux] Re: load average

---------

New Message Reply About this list Date view Thread view Subject view Author view

From: Şeref Tufan Şen (tufan@itu.edu.tr)
Date: Tue 05 Nov 2002 - 15:00:27 EET


Selam ,,
İlgili kod kısımları aşağıda. Çalışan (R) veya kesilemez uyku (D) durumunda olan süreç sayıları önemli olan.

include/linux/sched.c :
---------------------------
#define CALC_LOAD(load,exp,n) \
        load *= exp; \
        load += n*(FIXED_1-exp); \
        load >>= FSHIFT;

kernel/timer.c :
-----------------
static unsigned long count_active_tasks(void)
{
        struct task_struct *p;
        unsigned long nr = 0;

        read_lock(&tasklist_lock);
        for_each_task(p) {
                if ((p->state == TASK_RUNNING ||
                     (p->state & TASK_UNINTERRUPTIBLE)))
                        nr += FIXED_1;
        }
        read_unlock(&tasklist_lock);
        return nr;
}

static inline void calc_load(unsigned long ticks)
{
        unsigned long active_tasks; /* fixed-point */
        static int count = LOAD_FREQ;

        count -= ticks;
        if (count < 0) {
                count += LOAD_FREQ;
                active_tasks = count_active_tasks();
                CALC_LOAD(avenrun[0], EXP_1, active_tasks);
                CALC_LOAD(avenrun[1], EXP_5, active_tasks);
                CALC_LOAD(avenrun[2], EXP_15, active_tasks);
        }
}

On Tue, 5 Nov 2002 15:44:00 +0300
"JuniOrNet" <JuniOrNet@mynet.com> wrote:

>
> selam,
> linux'ta load average belirlenirken denklem nedir.
> ornegin vmstat ciktisinda cpu,I/O ve memory degerleri var.
> Neyi ne ile oranlayip bu load average bulunuyor ?
>
> tesekkurler
>
>
>

-- 
Şeref Tufan Şen
İTÜ-BİDB
Sistem Destek Grubu

----------------------------------------------------------------------- Liste üyeliğiniz ile ilgili her türlü işlem için http://liste.linux.org.tr adresindeki web arayüzünü kullanabilirsiniz.

Listeden çıkmak için: 'linux-request@linux.org.tr' adresine, "Konu" kısmında "unsubscribe" yazan bir e-posta gönderiniz. -----------------------------------------------------------------------


New Message Reply About this list Date view Thread view Subject view Author view

---------

Bu arsiv hypermail 2b29 tarafindan uretilmistir.