Changeset 10e16a7 in mainline for generic/src/proc/scheduler.c


Ignore:
Timestamp:
2006-02-04T13:51:35Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
428aabf
Parents:
c5613b7
Message:

Added scheduler queues output. The scheduler is buggy - on SMP
the cpus never get tu cpu_sleep, in slab2 test on 4 cpus everything
is on the first cpu.
The slab allocator passes tests in this configuration, but in slightly
different(more efficient) locking order it panics. TODO Find out why
does it panic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/proc/scheduler.c

    rc5613b7 r10e16a7  
    627627
    628628#endif /* CONFIG_SMP */
     629
     630
     631/** Print information about threads & scheduler queues */
     632void sched_print_list(void)
     633{
     634        ipl_t ipl;
     635        int cpu,i;
     636        runq_t *r;
     637        thread_t *t;
     638        link_t *cur;
     639
     640        /* We are going to mess with scheduler structures,
     641         * let's not be interrupted */
     642        ipl = interrupts_disable();
     643        printf("*********** Scheduler dump ***********\n");
     644        for (cpu=0;cpu < config.cpu_count; cpu++) {
     645                if (!cpus[cpu].active)
     646                        continue;
     647                spinlock_lock(&cpus[cpu].lock);
     648                printf("cpu%d: nrdy: %d needs_relink: %d\n",
     649                       cpus[cpu].id, cpus[cpu].nrdy, cpus[cpu].needs_relink);
     650               
     651                for (i=0; i<RQ_COUNT; i++) {
     652                        r = &cpus[cpu].rq[i];
     653                        spinlock_lock(&r->lock);
     654                        if (!r->n) {
     655                                spinlock_unlock(&r->lock);
     656                                continue;
     657                        }
     658                        printf("Rq %d: ", i);
     659                        for (cur=r->rq_head.next; cur!=&r->rq_head; cur=cur->next) {
     660                                t = list_get_instance(cur, thread_t, rq_link);
     661                                printf("%d(%s) ", t->tid,
     662                                       thread_states[t->state]);
     663                        }
     664                        printf("\n");
     665                        spinlock_unlock(&r->lock);
     666                }
     667                spinlock_unlock(&cpus[cpu].lock);
     668        }
     669       
     670        interrupts_restore(ipl);
     671}
Note: See TracChangeset for help on using the changeset viewer.