Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 May 2004 19:07:28 -0700 (PDT)
From:      Julian Elischer <julian@elischer.org>
To:        FreeBSD current users <current@FreeBSD.ORG>
Subject:   RFC for small change to 4bsd scheduler..
Message-ID:  <Pine.BSF.4.21.0405091855450.24403-100000@InterJet.elischer.org>

next in thread | raw e-mail | index | archive | help


in the following code:
struct kse *
sched_choose(void)
{
        struct kse *ke;
        struct runq *rq;

#ifdef SMP
        struct kse *kecpu;
            
        rq = &runq;
        ke = runq_choose(&runq);
        kecpu = runq_choose(&runq_pcpu[PCPU_GET(cpuid)]);

        if (ke == NULL ||
            (kecpu != NULL && 
**>>>>      kecpu->ke_thread->td_priority <
                ke->ke_thread->td_priority)) {
                     CTR2(KTR_4BSD, "choosing kse %p from pcpu runq %d", kecpu,
                     PCPU_GET(cpuid));
                ke = kecpu;
                rq = &runq_pcpu[PCPU_GET(cpuid)];
        } else {
                CTR1(KTR_4BSD, "choosing kse %p from main runq", ke);
        }



I think it would be better to have "<=" instead of "<"

I think the current code will make processes of equal priority thrash
processors if one is on the pcpu list and teh other is on the general
queue. as it is the pcpu process will only ever run when there is
nothing of teh same priority to run..

maybe there should be code to give such a case a 50/50 chance or
something?




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0405091855450.24403-100000>