On 09/27/07 17:15, [EMAIL PROTECTED] wrote:

Each CPU has a disp_t which contains a pointer to the first and last dispq_t for that cpu. There is one dispq_t allocated for each possible priority (see disp_cpu_init() in common/disp/disp.c) Real time threads will use priorities between 100 and 159. Currently, no other threads on the system
use the same priorities (at the same time), so, in that sense,
these are "real time" dispq's. Aside from allowing real time threads to pre-empt the kernel when/if they
become runnable,  they are scheduled like everything else.

That tell the story for realtime bound threads.
If a realtime thread is not bound to a cpu then it is not placed
on the dispatch queues of any one cpu but instead on a
partition-wide queue called the partition kernel preemption queue.
All cpus look at this for work to do.

In disp_init we have:

        kpreemptpri = (pri_t)v.v_maxsyspri + 1;
        if (kpqpri == KPQPRI)
                kpqpri = kpreemptpri;

So the standard threshold is anything above SYS priority -
genrally realtime.

and in set{front,back}dq:

        else if (!bound) {
                if (tpri >= kpqpri) {
                        setkpdq(tp, SETKP_{FRONT,BACK});
                        return;
                }

In looking for work we have:

static kthread_t *
disp()
{
        ...
        /*
         * If there is more important work on the global queue with a better
         * priority than the maximum on this CPU, take it now.
         */
        kpq = &cpup->cpu_part->cp_kp_queue;
        while ((pri = kpq->disp_maxrunpri) >= 0 &&
            pri >= dp->disp_maxrunpri &&
            (cpup->cpu_flags & CPU_OFFLINE) == 0 &&
            (tp = disp_getbest(kpq)) != NULL) {
        ...
}

And disp_getwork does:

        kpq = &cp->cpu_part->cp_kp_queue;
        while (kpq->disp_maxrunpri >= 0) {
                /*
                 * Try to take a thread from the kp_queue.
                 */
                tp = (disp_getbest(kpq));
                if (tp)
                        return (disp_ratify(tp, kpq));
        }

Gavin

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to