主にDebian/GNU Linux (etch以降)についての覚書き
目次
カーネル
タスクスケジューラ
root権限でスケジューラに対して,プロセスがactive queueにあり続けるように
すれば,そのプロセスがCPUを独占できる?(--> 計測/制御プログラムの場合,有用)
2.4.22時点での情報のようにgettimeofday()とnanosleep()を組み合わせれば十分?
reemptive kernelの場合は?
カーネル2.6.18,sched.c, 555行
/*
* Called when a process is dequeued from the active array and given
* the cpu. We should note that with the exception of interactive
* tasks, the expired queue will become the active queue after the active
* queue is empty, without explicitly dequeuing and requeuing tasks in the
* expired queue. (Interactive tasks may be requeued directly to the
* active queue, thus delaying tasks in the expired queue from running;
* see scheduler_tick()).
*
* This function is only called from sched_info_arrive(), rather than
* dequeue_task(). Even though a task may be queued and dequeued multiple
* times as it is shuffled about, we're really interested in knowing how
* long it was from the *first* time it was queued to the time that it
* finally hit a cpu.
*/
static inline void sched_info_dequeued(struct task_struct *t)
{
t->sched_info.last_queued = 0;
}
最終更新:2008年06月21日 20:12