Subversion Repositories HelenOS

Rev

Rev 3149 | Rev 4339 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3149 Rev 3191
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%" PRIu64 ": unexpected state %s\n", THREAD->tid,
454
            panic("tid%" PRIu64 ": unexpected state %s\n",
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%u: tid %" PRIu64 " (priority=%d, ticks=%" PRIu64 ", 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%u: TID %" PRIu64 " -> cpu%u, nrdy=%ld, "
643
                printf("kcpulb%u: TID %" PRIu64 " -> cpu%u, "
644
                    "avg=%ld\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);