Rev 3022 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3022 | Rev 4055 | ||
---|---|---|---|
Line 449... | Line 449... | ||
449 | 449 | ||
450 | default: |
450 | default: |
451 | /* |
451 | /* |
452 | * Entering state is unexpected. |
452 | * Entering state is unexpected. |
453 | */ |
453 | */ |
454 | panic("tid%llu: unexpected state %s\n", THREAD->tid, |
454 | panic("tid%" PRIu64 ": unexpected state %s.", |
455 | thread_states[THREAD->state]); |
455 | THREAD->tid, thread_states[THREAD->state]); |
456 | break; |
456 | break; |
457 | } |
457 | } |
458 | 458 | ||
459 | THREAD = NULL; |
459 | THREAD = NULL; |
460 | } |
460 | } |
Line 502... | Line 502... | ||
502 | 502 | ||
503 | spinlock_lock(&THREAD->lock); |
503 | spinlock_lock(&THREAD->lock); |
504 | THREAD->state = Running; |
504 | THREAD->state = Running; |
505 | 505 | ||
506 | #ifdef SCHEDULER_VERBOSE |
506 | #ifdef SCHEDULER_VERBOSE |
507 | printf("cpu%d: tid %llu (priority=%d, ticks=%llu, nrdy=%ld)\n", |
507 | printf("cpu%u: tid %" PRIu64 " (priority=%d, ticks=%" PRIu64 |
508 | CPU->id, THREAD->tid, THREAD->priority, THREAD->ticks, |
508 | ", nrdy=%ld)\n", CPU->id, THREAD->tid, THREAD->priority, |
509 | atomic_get(&CPU->nrdy)); |
509 | THREAD->ticks, atomic_get(&CPU->nrdy)); |
510 | #endif |
510 | #endif |
511 | 511 | ||
512 | /* |
512 | /* |
513 | * Some architectures provide late kernel PA2KA(identity) |
513 | * Some architectures provide late kernel PA2KA(identity) |
514 | * mapping in a page fault handler. However, the page fault |
514 | * mapping in a page fault handler. However, the page fault |
Line 638... | Line 638... | ||
638 | /* |
638 | /* |
639 | * Ready t on local CPU |
639 | * Ready t on local CPU |
640 | */ |
640 | */ |
641 | spinlock_lock(&t->lock); |
641 | spinlock_lock(&t->lock); |
642 | #ifdef KCPULB_VERBOSE |
642 | #ifdef KCPULB_VERBOSE |
643 | printf("kcpulb%d: TID %llu -> cpu%d, nrdy=%ld, " |
643 | printf("kcpulb%u: TID %" PRIu64 " -> cpu%u, " |
644 | "avg=%nd\n", CPU->id, t->tid, CPU->id, |
644 | "nrdy=%ld, avg=%ld\n", CPU->id, t->tid, |
645 | atomic_get(&CPU->nrdy), |
645 | CPU->id, atomic_get(&CPU->nrdy), |
646 | atomic_get(&nrdy) / config.cpu_active); |
646 | atomic_get(&nrdy) / config.cpu_active); |
647 | #endif |
647 | #endif |
648 | t->flags |= THREAD_FLAG_STOLEN; |
648 | t->flags |= THREAD_FLAG_STOLEN; |
649 | t->state = Entering; |
649 | t->state = Entering; |
650 | spinlock_unlock(&t->lock); |
650 | spinlock_unlock(&t->lock); |
Line 706... | Line 706... | ||
706 | 706 | ||
707 | if (!cpus[cpu].active) |
707 | if (!cpus[cpu].active) |
708 | continue; |
708 | continue; |
709 | 709 | ||
710 | spinlock_lock(&cpus[cpu].lock); |
710 | spinlock_lock(&cpus[cpu].lock); |
711 | printf("cpu%d: address=%p, nrdy=%ld, needs_relink=%ld\n", |
711 | printf("cpu%u: address=%p, nrdy=%ld, needs_relink=%" PRIc "\n", |
712 | cpus[cpu].id, &cpus[cpu], atomic_get(&cpus[cpu].nrdy), |
712 | cpus[cpu].id, &cpus[cpu], atomic_get(&cpus[cpu].nrdy), |
713 | cpus[cpu].needs_relink); |
713 | cpus[cpu].needs_relink); |
714 | 714 | ||
715 | for (i = 0; i < RQ_COUNT; i++) { |
715 | for (i = 0; i < RQ_COUNT; i++) { |
716 | r = &cpus[cpu].rq[i]; |
716 | r = &cpus[cpu].rq[i]; |
717 | spinlock_lock(&r->lock); |
717 | spinlock_lock(&r->lock); |
718 | if (!r->n) { |
718 | if (!r->n) { |
719 | spinlock_unlock(&r->lock); |
719 | spinlock_unlock(&r->lock); |
720 | continue; |
720 | continue; |
721 | } |
721 | } |
722 | printf("\trq[%d]: ", i); |
722 | printf("\trq[%u]: ", i); |
723 | for (cur = r->rq_head.next; cur != &r->rq_head; |
723 | for (cur = r->rq_head.next; cur != &r->rq_head; |
724 | cur = cur->next) { |
724 | cur = cur->next) { |
725 | t = list_get_instance(cur, thread_t, rq_link); |
725 | t = list_get_instance(cur, thread_t, rq_link); |
726 | printf("%llu(%s) ", t->tid, |
726 | printf("%" PRIu64 "(%s) ", t->tid, |
727 | thread_states[t->state]); |
727 | thread_states[t->state]); |
728 | } |
728 | } |
729 | printf("\n"); |
729 | printf("\n"); |
730 | spinlock_unlock(&r->lock); |
730 | spinlock_unlock(&r->lock); |
731 | } |
731 | } |